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

Re: Tagging, switching, and messing up the tag

From: Sean Laurent <sean_at_neuronfarm.com>
Date: 2005-01-12 18:57:09 CET

On Wednesday 12 January 2005 11:42 am, Bryan Donlan wrote:
> On Wed, 12 Jan 2005 17:42:26 +0100, Andrea Carpani
> > 2. Is there a way I can create "uncommittable" tags (copies)?
> Make a pre-commit script which rejects changes to tags. There may be
> one made already somewhere.
> http://svnbook.red-bean.com/en/1.1/ch05s02.html#svn-ch-5-sect-2.1

You should be able to find a number of implementations in the mailing list
archives. Here's mine, which is directly based on someone else's suggestion:

# Prevent modification of existing tags
$SVNLOOK changed -t "$TXN" "$REPOS" | grep "tags/" >/dev/null
if [ $? -eq 0 ] ;
  $SVNLOOK changed -t "$TXN" "$REPOS" | egrep "^[AD]
[[:space:]]+(.*/)?tags/[^/]+/$" >/dev/null
  if [ $? -ne 0 ] ;
    echo >&2 "Modification of tags is not allowed. Commit aborted!" 1>&2
    exit 1

Basically, this allows the creation of new tags and the deletion of existing
tags, but does not allow modifications to existing tags. If the transaction
affected "tags" and was NOT an add or delete, the hook rejects the commit.

The things that come to those that wait may be the things left by those who
got there first.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jan 12 19:01:06 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.