On Thu, Dec 23, 2010 at 10:56:17AM -0600, Les Mikesell wrote:
> On 12/23/2010 10:24 AM, Stefan Sperling wrote:
> >
> >>If you don't need to write/modify something there, why should it be
> >>created if it doesn't already exist? Can't you defer the decision
> >>to create until you need a write?
> >
> >That would mean going into the code of each operation within
> >libsvn_client and sprinkle calls to the config creation code
> >depending on what the operation is going to do.
>
> Seems like it should fit in an error handler somewhere. Let the
> write fail in the uncommon case and fix things up only when needed.
That still means checking for this error in many places and retry.
We have no way to jump back down to where the error was thrown,
other than calling the error-throwing function again. If you catch
the error at a high level this means you'd effectively have to restart
the entire operation (like, say, "svn merge", which may or may not write
to files and properties in the WC). So you need to catch it as early
as possible. This means you'll have to catch it in many places.
One place where you could put this (in theory) is a write lock being
obtained on a WC. But this causes a bit of a layering problem,
because client config stuff shouldn't be handled within the working
copy library.
Maybe there really is a good way of doing what you'd like to do,
but I don't see how. You could try to have a look into the code
yourself to see if you can find a way to do it. I suppose it also
depends on what you would call a "write" operation in this context.
Does creating temporary files count, for example?
Stefan
Received on 2010-12-23 18:37:53 CET