I want to do the following:
When one user is editing a file from SVN, no other user can edit this file until the first user commits his changes. That is there would be some kind of writelock on files in svn.
Is this possible in SVN? How to do it? Is it possible to set this for a single file or directory (not for the whole repository)?
Why would this be useful? Conflicts on binary and some other files cannot be easily resolved. I would like to set my excel files in svn to be write locked in the way described above.
I would welcome guide on how to do this in VisualSVN or TortoiseSVN which I use.
You can set the property svn:needs-lock
on such files, then the file gets checked out "read only". If you want to edit it, you have to lock the file with svn lock
. That workflow is there for exactly this case.
See here http://svnbook.red-bean.com/en/1.5/svn.ref.properties.html for info on svn:needs-lock
.
The "svn lock" command prevents other people from committing changes to a file. It can't keep you from editing the file, since svn has no control of the file itself once it's checked out. You can procedurally tell everyone to lock the binary file before editing to prevent someone from making edits they cannot commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With