views:

60

answers:

2

Hi,

i am using subversion as RCS. Always when a new version of my project is finised i create a tag of it (copy of the trunk). Does anybody know how i can protect this tagged directory from being accidentally modified?

At the moment as a workaround i lock all files. But this sill means that the user with the lock can edit the files.

Is there any better solution?

+4  A: 

You can use a pre-commit hook to prevent users from writing to a tags directory after it has been created.

See this related SO question for examples:
SVN pre-commit hook for avoiding changes to tags subdirectories

Tim Henigan
Pre-commit hooks are scripts that can do more complex things, like only allow changes in the tags directories by certain users.
dj_segfault
If a pre-commit hook is the official way i will set the SVN attribute "svn:needs-lock" on all files instead.
Alexander
Don't do setting the property on all files...this is against the idea of SVN. The answer given about path-based-authorization is the correct way.
khmarbaise
A: 

You can give read only permission on the tag directories using path-pased authorization.

Davide Gualano
The problem with this solution is that you can't create new `tags`. If certain users are granted write permission, there is always a chance of mistakenly modifying files within a tag.
Tim Henigan
You can set in read only the tags after creating them, leaving the usual /tags subdirectory writeable: es: /myproject/tags is writeable, while /myproject/tags/my-first-tag is set to readonly after the tag creation.
Davide Gualano