You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by DePriest Richard 403 <ri...@crackerbarrel.com> on 2008/02/27 14:06:19 UTC

Pre-commit hook

We are new users of subversion and would like to set up a pre-commit
hook to not allow an user to commit a file that another user has a lock
on. Is there an example of said hook that I could eyeball. I have been
searching and couldn't find an example of this kind of hook.
 
Any help would be greatly appreciated.
 
Rick DePriest
Project Manager - Retail Systems
Cracker Barrel Old Country Stores, Inc.
Ph. (615) 443-9845
Email: rdepries@crackerbarrel.com
 

Re: Pre-commit hook

Posted by Andy Levy <an...@gmail.com>.
On Wed, Feb 27, 2008 at 6:17 PM, Kevin Grover <ke...@kevingrover.net> wrote:
>
> On Wed, Feb 27, 2008 at 6:06 AM, DePriest Richard 403
> <ri...@crackerbarrel.com> wrote:
>
> >
> >
> > We are new users of subversion and would like to set up a pre-commit hook
> to not allow an user to commit a file that another user has a lock on. Is
> there an example of said hook that I could eyeball. I have been searching
> and couldn't find an example of this kind of hook.
> >
> > Any help would be greatly appreciated.
> >
> > Rick DePriest
> > Project Manager - Retail Systems
> > Cracker Barrel Old Country Stores, Inc.
> > Ph. (615) 443-9845
> > Email: rdepries@crackerbarrel.com
> >
>
>
> If you use the svn:needs-lock mechanism, you don't need any hook scripts.
> SVN handles it for you.
>
> See the docs: http://svnbook.red-bean.com/en/1.4/svn.advanced.locking.html
>
>  The crux of it is no one else can modify a file when I have a lock (unless
> they manually circumvent the read-only access).  Even if they manually set
> the file to writable and modify it, they can't commit it because they don't
> have the lock.

Unless they use svn lock --force to steal the lock from you.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Pre-commit hook

Posted by Kevin Grover <ke...@kevingrover.net>.
On Wed, Feb 27, 2008 at 6:06 AM, DePriest Richard 403 <
richard.depriest@crackerbarrel.com> wrote:

>  We are new users of subversion and would like to set up a pre-commit hook
> to not allow an user to commit a file that another user has a lock on. Is
> there an example of said hook that I could eyeball. I have been searching
> and couldn't find an example of this kind of hook.
>
> Any help would be greatly appreciated.
>
> Rick DePriest
> Project Manager - Retail Systems
> Cracker Barrel Old Country Stores, Inc.
> Ph. (615) 443-9845
> Email: rdepries@crackerbarrel.com
>
>


If you use the svn:needs-lock mechanism, you don't need any hook scripts.
SVN handles it for you.

See the docs: http://svnbook.red-bean.com/en/1.4/svn.advanced.locking.html

The crux of it is no one else can modify a file when I have a lock (unless
they manually circumvent the read-only access).  Even if they manually set
the file to writable and modify it, they can't commit it because *they *don't
have the lock.