[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Email stolen lock to original lock holder

From: Dirk Schenkewitz <schenkewitz_at_docomolab-euro.com>
Date: 2005-06-08 11:23:27 CEST

Ben Collins-Sussman wrote:
>
> On Jul 7, 2005, at 2:08 AM, Bruno Gustavs wrote:
>
>> This post referes to Subversion 1.2.0.
>>
>> I tried to notify stolen locks by email to the original lock holder.
>> When I notify from the pre-lock script I get far too much
>> notifications, because the pre-lock script runs even if the
>> svn lock command is run without --force and will fail therefore.
>
>
> Aha! This is definitely a bug.
>
> The libsvn_repos library invokes 'pre-lock' before asking the
> filesystem (libsvn_fs) to create the lock. libsvn_repos knows whether
> or not the user passed --force, and it can find out if a lock already
> exists... so instead of running pre-lock and letting libsvn_fs reject
> the request, *libsvn_repos* should be rejecting the request upfront,
> and not run 'pre-lock' at all.

I just thought about a 'start-lock' hook that is run in any case, maybe
it could be given about existing lock and --force, like so:

start-lock REPOS-PATH PATH-TO-LOCK USERNAME LOCK-EXISTS FORCE-USED

where LOCK-EXIST can either be "locked" or "no_lock"
and FORCE can either be "forced" or "no_force"

e.g.

start-lock /svn/repos/frobnoz trunk/photos/title.jpg dirk locked forced

That would provide the possibility to fine-tune permissions to break
locks or deny it on a user/dir/file basis.

Or, if the 'pre-lock' could get the information whether a path is
locked and/or the user used --force, it could take that into account
and not send the email if it would return failure anyway.

But if someone tries to lock a file that is already locked but does
not use --force, that combination could be used to send a mail to the
lock-holder and ask nicely to release the lock.

Just some ideas - What do you think?

Best regards
   Dirk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jul 8 11:25:47 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.