[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 question

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2004-05-25 17:42:53 CEST

Tim Van Epps <tvanepps@efs-us.com> writes:

> Hello,
> I wrote a pre-commit hook that prevents users from running svn
> commit against a path that includes "releases/"; unfortunately, this
> hook also prevents users from creating new releases. Can I write a
> pre-commit hook that will allow 'svn copy http://svn/trunk
> http://svn/releases' but not allow a svn commit into the new release
> branch. Or, to put it differently, can I write a pre-commit hook or
> other software that will allow users to create a new branch but not
> update the branch once created.

Have you hook run 'svnlook changed ${REPOS} -t ${TXN}', and verify
that the only change is an 'A' (added) line for a path directly under
/releases. If it isn't bail. But if it is, you could even have it
also run 'svnlook dirschanged ${REPOS} -t ${TXN}' and verify that that
one changed path is a directory. Of course, this would allow any old
directory creation under /releases, copy or not.

Or, if you have language bindings available, you could write a script
which does *exactly* what you want because it could directly access
the repos via the APIs.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue May 25 17:43:48 2004

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.