On 9/8/06, Grant Rettke <grettke@acm.org> wrote:
> Hi,
>
> I've got a pre-commit hook script (in perl) that prohibits updates and
> deletes to project tags. What I would really love is to have one script
> that allows folks to ADD to a project tag only once, and never add
> anything again after that.
>
> Do you think it would be possible to do so in a single script?
>
> I have yet to look deeply into this.
>
> Here is my current script for disallowing updates and deletes.
>
> $repository = $ARGV[0];
> $transaction = $ARGV[1];
>
> $svnlook = "/usr/bin/svnlook";
>
> $change_cmd = $svnlook . " changed " . $repository . " -t " . $transaction;
>
> @changes = `$change_cmd`;
>
> foreach $change (@changes) {
> if( $change =~ /^[UD]\W+.+\/tags\// )
> {
> print STDERR
>
> "\n***\n" .
> "\nUpdates and deletes to project tags are forbidden.\n" .
> "\nPlease contact your repository administrator if you have " .
> "any questions or concerns about this policy.\n" .
> "\n***\n";
>
> exit 1;
> } }
>
> exit 0;
Have you looked at svnperms.py yet? It may be able to help you out.
Why reinvent the wheel?
http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Sep 9 02:44:34 2006