You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Eric Himmelreich <eh...@cimx.com> on 2008/09/10 13:12:13 UTC
pre-lock hook in a windows environment
I'm having some trouble here implementing a pre-lock hook. I'm trying
to prevent locks from being broken (the subversion book casually
mentions that this is possible with a pre-lock hook, but provides no
information as to how to implement). My ideal situation would allow
only 1 user (the administrator) to break/steal locks, all other users
would receive an error message "cannot break lock... see admin" or
something. I've setup subversion using svnserve (running on a separate
windows box). I'm trying to write my script in python, but a solution
in any language would be appreciated (provided it can work on windows
xp).
Eric A. W. Himmelreich
Re: pre-lock hook in a windows environment
Posted by eg <eg...@gmail.com>.
Eric Himmelreich wrote:
> I’m having some trouble here implementing a pre-lock hook. I’m trying
> to prevent locks from being broken (the subversion book casually
> mentions that this is possible with a pre-lock hook, but provides no
> information as to how to implement). My ideal situation would allow
> only 1 user (the administrator) to break/steal locks, all other users
> would receive an error message “cannot break lock… see admin” or
> something. I’ve setup subversion using svnserve (running on a separate
> windows box). I’m trying to write my script in python, but a solution
> in any language would be appreciated (provided it can work on windows xp).
>
>
Have you looked at the pre-lock.tmpl found in the hooks directory of
your repository?
It is a well documented template for a script written for a Unix /bin/sh
interpreter. You will need to turn this into something windows
compatible (a batch file would do).
Of course, you can use Python to implement the logic but you will need
to make the pre-lock.bat file act as a wrapper and explicitly call your
python script and pass in the 3 arguments.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org