You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Peter N. Lundblad" <pe...@famlundblad.se> on 2005/05/18 20:22:48 UTC
[PATCH] Don't lock whole WC in svn lock/unlock (was: Re: svn commit:
r14736 - in trunk/subversion: tests/clients/cmdline)
On Sat, 14 May 2005, Philip Martin wrote:
> "Peter N. Lundblad" <pe...@famlundblad.se> writes:
>
> > Seems a little heavy-weight to me. This means that if I lock a file in the
> > root of the repository, svn will lock the whole WC.
> >
> > Wouldn't it be possible to, in the loop below, just svn_wc_adm_probe_try3
> > all the parents of each path from left to right?
>
> Yes, it might be possible. I'm not sure such code really belongs in
> lock/unlock, I feel it would be better as part of the access baton
> code.
>
This simple fix will at least avoid locking the whole WC in many cases.
Seems OK?
Best,
//Peter
Re: [PATCH] Don't lock whole WC in svn lock/unlock
Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 19 May 2005, Philip Martin wrote:
> "Peter N. Lundblad" <pe...@famlundblad.se> writes:
>
> > On Wed, 18 May 2005, Philip Martin wrote:
> >
> >> "Peter N. Lundblad" <pe...@famlundblad.se> writes:
> >>
> >> Given that we only lock files, does n-1 work?
> >>
> > I thought about that, but I don't think it is worth it leaving a latent
> > bug when/if we support dir locking.
>
> I wouldn't worry about that, if directory locks ever get implemented I
> expect it to be immediately apparent that this needs to change.
>
>
OK, I committed my version. I don't care to change that now:-) I think the
real solution is to do what commit does, namely keep track of all dirs to
lock and lock their parents. That's more complicated, though.
thanks,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Don't lock whole WC in svn lock/unlock
Posted by Philip Martin <ph...@codematters.co.uk>.
"Peter N. Lundblad" <pe...@famlundblad.se> writes:
> On Wed, 18 May 2005, Philip Martin wrote:
>
>> "Peter N. Lundblad" <pe...@famlundblad.se> writes:
>>
>> Given that we only lock files, does n-1 work?
>>
> I thought about that, but I don't think it is worth it leaving a latent
> bug when/if we support dir locking.
I wouldn't worry about that, if directory locks ever get implemented I
expect it to be immediately apparent that this needs to change.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Don't lock whole WC in svn lock/unlock (was: Re: svn
commit: r14736 - in trunk/subversion: tests/clients/cmdline)
Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Wed, 18 May 2005, Philip Martin wrote:
> "Peter N. Lundblad" <pe...@famlundblad.se> writes:
>
> Given that we only lock files, does n-1 work?
>
I thought about that, but I don't think it is worth it leaving a latent
bug when/if we support dir locking.
Thanks,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Don't lock whole WC in svn lock/unlock (was: Re: svn
commit: r14736 - in trunk/subversion: tests/clients/cmdline)
Posted by Philip Martin <ph...@codematters.co.uk>.
"Peter N. Lundblad" <pe...@famlundblad.se> writes:
> This simple fix will at least avoid locking the whole WC in many cases.
> Seems OK?
Looks like a good idea.
> --- subversion/libsvn_client/locking_commands.c (revision 14773)
> +++ subversion/libsvn_client/locking_commands.c (arbetskopia)
> @@ -203,10 +203,23 @@
> }
> else /* common parent is a local path */
> {
> + int max_depth = 0;
> +
> + /* Calculate the maximum number of components in the rel_targets, which
> + is the depth to which we need to lock the WC. */
> + for (i = 0; i < rel_targets->nelts; ++i)
> + {
> + const char *target = ((const char **) (rel_targets->elts))[i];
> + int n = svn_path_component_count (target);
> +
> + if (n > max_depth)
> + max_depth = n;
Given that we only lock files, does n-1 work?
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org