Adding the SVN needs-lock property

How can I add the svn:needs-lock property to existing managed files?

The svn:needs-lock property tells Subversion that a file can only be modified if you first obtain an exclusive lock with svn lock. The subversion config file defines which files require needs-lock and the property is set automatically when a file is added to the repository.

However, if your data was already in a Subversion repository, or data was added with a different config file, you may have to add the svn:needs-lock property manually to files in your workarea:

Unix> find . -type f | grep -v /.svn/ | xargs svn propset svn:needs-lock 1
Unix> svn commit -m 'Added needs-lock property'

SVN 1.8 improvements

Note in the 1.8 release of Subversion this property can be enforced on the server which will reduce the incidence of this issue considerably

See the Subversion documentation for more information:

http://subversion.apache.org/docs/release-notes/1.8.html#repos-dictated-config