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

Re: How do I disable tag modification?

From: Wolfgang Fritz <wolfgang.fritz_at_keymile.com>
Date: 2004-09-14 14:59:37 CEST

Max Bowsher wrote:
> Wolfgang Fritz wrote:
>> Hello,
>>
>> I'm trying to disable the modification of tags after creation.
>> My tags are located in a project/tags directory as proposed in the "book".
>>
>> Users should be able to create a tag but should never be able to modify
>> an existing tag (maybe delete a tag, that's under discussion)
>>
>> I see that using a pre-commit hook is probably the way to go. In the
>> hook script I want to do the following:
>>
>> If a subdirectory */tags/foobar is involved in the commit (svnlook
>> dirs-changed) and this directory already exists: abort the commit.
>> Otherwise: perform the commit.
>>
>> Unfortunately I have not found an easy way to check if the directory
>> */tags/foobar already exists. I see that in the "svnlook tree
>> --show-ids" output, new directories seem to have ids of the form
>> <4._0.t21-1> (the _0), but maybe there is a better way.
>>
>> Completely different approaches which achieve my goal are of course
>> welcome :-)
>
> Run svnlook changed
> If any lines match "^.. tags/[^/]+/.+$" then deny the commit
>

Aha! "svnlook changed" seems to be what I have looked for. But wouldn't
the expression above prevent the creation of tags too? If I create a
tag, I get output like:

A project1/tags/tag1/
A project1/tags/tag1/Datei1
A project1/tags/tag1/fdflush.c
A project1/tags/tag1/modprobe.c

So I should probably allow the commit if I find a line of the form
A project1/tags/tag1/

(and possibly
D project1/tags/tag1/
if we allow tag deletion)

Wolfgang
> Max
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Sep 14 15:00:55 2004

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.