tags:

views:

1585

answers:

3

Hi I was wondering if there is a way for the SVN server to automatically assign the svn:needs-lock property on any file that is binary and not textual.

We have a rather small developers team but resting on everyone to remember to set this property on newly created binary files doesn't make sense since it's very easy to forget such a thing.

+4  A: 

edit the svn config file and add an entry for auto props:

http://svnbook.red-bean.com/en/1.5/svn.advanced.props.html#svn.advanced.props.auto

Stefan
+1  A: 

It should be noted that the auto props method has to be configured on each SVN client being used. So when you're setting up a new developer, or an existing developer on a new machine, you have to remember to perform this configuration.

If you are all using TortoiseSVN, you can set the tsvn:autoprops property on the base folder of each checkout and it will be honoured by all TortoiseSVN clients.

If you really want to nail it, you'll need to put a pre-commit hook in each repository. The enforcer script might be easily tooled for this.

If you have any python-fu, RepoGuard (the successor to SVNChecker) looks like it could be useful too.

No matter which you pick, there's no way to retroactively apply the property to existing files in the repository, I think. You can probably enforce it on the next commit of the file, however.

Evan
A: 

There's a page on this Subversion wiki that describes all the different options on how to automatically add needs-lock and how to guarantee it has been set. The page also gives example scripts and configuration details:

http://www.orcaware.com/svn/wiki/Automatic_lock-modify-unlock

japher