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

Re: hook scripts: only commit if locked

From: Alan Barrett <apb_at_cequrux.com>
Date: 2005-11-11 10:21:09 CET

On Thu, 03 Nov 2005, Noam Tamim wrote:
> What I really want, is the ability to enforce the following rule:
> A user can only commit changes to a needs-lock file if he/she has locked
> that file.
>
> Is it possible, with some configuration or hook scripts?

You should be able to write a pre-commit script that does something like

   get list of files from svnlook
   for each file:
      if needs-lock and not is-locked:
         print error message to stderr
         remember that there was an error
   if there was an error:
      exit with error code

Have a look at contrib/hook-scripts/pre-lock-require-needs-lock.py
which does a different job, but contains examples of the programming
techniques you would need to use.

--apb (Alan Barrett)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Nov 11 10:25:39 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.