views:

85

answers:

4

I have a file in repo which I do not want anybody to update.

What can I do?

+4  A: 

You want svn lock: http://www.linxit.de/svnbook/en/1.2/svn.ref.svn.c.lock.html

Josh
A lock can be stolen by `svn lock --force`. So it's only useful to prevent accidential commits.
tangens
+1  A: 

You can also set files as ignore-on-commit in Tortoise, meaning you can make local changes to the file which will not be committed when you commit the tree.

This will not prevent other people from changing the file, but will prevent you checking in changes to it. I have use this to prevent myself checking in local modification to configuration files.

tarn
For non-GUI users this functionality is mirrored in 'svn ignore'.
Josh
svn ignore works for all users, while ignore-on-commit works for local user.
Rohit
Use ignore-on-commit with lock for best results.
Rohit
+2  A: 

You could give this file a special permission so that it's only readable by everyone (or at least by the group that should not update that file).

How to set the permission depends on the svn server you use. If you use svnserve you have to put the permissions in the file conf/authz inside your repository. If you have an apache wrapping the access to svn, you have to configure the permissions there.

tangens
A: 

There's always pre-commit hooks. Use svnlook on the transaction to see what files it modifies, if it includes your special file, return a failure and an error message. http://subversion.tigris.org/tools_contrib.html#commit_access_control_pl

Jim T