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

RE: Making tags read-only - use commit-access-control.pl ?

From: Engebakken Geir <geir.engebakken_at_edb.com>
Date: Thu, 4 Sep 2008 14:31:42 +0200

I tried this script, but it failed for us. I found the problem, and it was that it greps for ^tags in the TXN, but as I found out our TXN line looked like this :

Projecta/tags/pathtofile

When removing the ^ in front of the grep pattern it worked, of course this means that any TXN with the letters tags in them will fail, so it should be at least improved to grep for /tags/, but I havent had much time to really dig deep into this script yet.

Geir

-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2008c_at_ryandesign.com]
Sent: 3. september 2008 18:27
To: David Aldrich
Cc: users_at_subversion.tigris.org; 'david.x.grierson_at_jpmorgan.com'; Rock Sun
Subject: Re: Making tags read-only - use commit-access-control.pl ?

On Sep 3, 2008, at 4:54 AM, David Aldrich wrote:

>> http://svn.haxx.se/users/archive-2005-11/0056.shtml
>
> Thanks for directing me to the above thread.
>
> The condition in the example given in the thread is:
>
> # Deny transaction if any line writes to tags directory that exists.
>
> I have an unusual requirement from a user who wants to prevent
> modification of any files in a tag, but to allow addition of files to
> a tag. (I know this doesn't sound like the usual use of tag).
> Any idea how I could implement that?

Sure. The hook script given above runs "$SVNLOOK" changed -t "$TXN"
"$REPOS" and looks at the second word (presumably intended to be the path to the file, though this will fail if the path to the file ever contains spaces). You would need to add code to look at the first character of the response from svnlook changed rather than throwing it away like the script does. The first character will be "A" if a file is added (which you want to allow) and "M" if a file is modified (which you want to deny). You can also handle "D" (deleted) in any way you choose.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-09-05 19:46:02 CEST

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.