You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Tim Van Epps <tv...@efs-us.com> on 2004/05/25 15:19:25 UTC
pre-commit hook question
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.
Thanks,
--
Tim Van Epps
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: pre-commit hook question
Posted by Branko Čibej <br...@xbc.nu>.
C. Michael Pilato wrote:
>Tim Van Epps <tv...@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.
>
>
Or just use the commit-accdess-control.pl script that's already in the
Subversino repository.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: pre-commit hook question
Posted by "C. Michael Pilato" <cm...@collab.net>.
Tim Van Epps <tv...@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