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

How to write a pre-commit hook script that disallows UAD to project tags?

From: Grant Rettke <grettke_at_acm.org>
Date: 2006-09-08 23:42:42 CEST


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" .

                exit 1;
        } }

exit 0;

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Sep 8 23:44:18 2006

This is an archived mail posted to the Subversion Users mailing list.