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

Re: Pre-commit hook

From: Kevin Grover <kevin_at_kevingrover.net>
Date: Wed, 27 Feb 2008 15:17:19 -0800

On Wed, Feb 27, 2008 at 6:06 AM, DePriest Richard 403 <
richard.depriest_at_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_at_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.
Received on 2008-02-28 00:17:42 CET

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.