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

Ant: Re: Email stolen lock to original lock holder

From: Bruno Gustavs <bg2svn_at_yahoo.de>
Date: 2005-07-12 08:19:17 CEST

Dirk Schenkewitz wrote:
> 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:
> 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

Personally I think a pre-lock script is enought to control permissions,
because svnlook gives you all required information except the --forced
option. If the --forced is checked before the pre-lock script is called
(svn's /trunk, r15290), everything is fine.

Concerning the notification of original lock holders, I think there is
room for improvements. At the moment the post-lock script is called
for each lock. In the comments of the post-lock template it is mentioned
that in Subversion 1.3 multiple locks will be notified to STDIN of the
post-lock script.

Assume the following changes:
1) Subversion calls the post-lock script once for all locked files without
   previous lock e.g.
      post-lock REPOS_PATH USER < relpath-of-all-locked-files

2) Subversion calls the post-lock script for each original lock holder
   with the user name of the original lock holder as third argument e.g.
      post-lock REPOS_PATH USER ORIG_USER < relpath-of-all-locked-files

This would allow to notify the original lock holders *after* the lock
is stolen with a single email even if multiple locks are stolen at the
same time.

Please note that this extension does not break existing post-lock scripts.
The same extensions apply to the post-unlock script.

Best Regards

Gesendet von Yahoo! Mail - Jetzt mit 1GB kostenlosem Speicher
Received on Tue Jul 12 08:21:19 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.