On Tue, Mar 15, 2011 at 8:25 AM, Michael Diers <mdi...@elego.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 2011-03-10 11:21, Michael Diers wrote: > > On 2011-03-10 08:23, Waseem Bokhari wrote: > >> This script works fine in all scenarios except Anyone can Steal Lock > when Unlock. > > > >>> Unable to Break lock through check for modifications Option > >>> Unable to break lock through Repo browser > >> BUT > >> Only any user can Steal Lock when he tried to Get Lock and > Check the below mentioned Option of Steal Lock. > > > > Waseem, > > > > I'm not following. Could you please express the scenarios in terms of > > command line client operations? (Otherwise, dedicated TortoiseSVN forums > > might be a better place to ask for assistance.) > > > > For instance, "Unable to break lock through Repo browser" translates to > > "Unable to break lock through `svn unlock --force'". > > OK, there are two ways to get rid of locks owned by some other user: > > "stealing a lock" by running `svn lock --force' > > and > > "breaking a lock" by running `svn unlock --force'. > > If you want to hook these operations, you need a pre-lock hook script > and a a pre-unlock hook script, respectively. Note that in both cases, > the fact that the user specified "--force" is not communicated to the > hook script. > > It appears you want to completely disallow "stealing" and "breaking" of > locks. So, for both hook scripts, if the calling user is not identical > to the lock owner, you want to fail the hook script. > > Does that sound about right? > In addition to this, locks are for a working-copy, not necessarily for a user. It's possible for the same user to steal the lock that they already hold in another working copy, and your script will let them. Cheers, Daniel B.