Reputation: 2967
I want to lock my repository so that if any file is edited it needs to get svnlock on itself to do so. I have done this with svn-lock on every file, but I dont have a script to add this to new files and ensure its still on the file next time its committed.
I wondered if there are scripts i can use in the svnserver to setup and ensure these are there always in my repository?
I have looked around stackoverflow and googled, many pages but i cant find a simple script that i understand to do this. and i dont want to just copy and paste a script just in case its malicious.
can you surggest scripts or better yet detail them here so i understand and can implement this properly please.
Upvotes: 1
Views: 314
Reputation: 30662
Are you aware of svn:needs-lock
property? Please check the Lock Communication chapter of the SVNBook for the details. You can set the property recursively on your repository and users will be prompted to lock a file before they can modify it.
Subversion's solution to this problem is to provide a mechanism to remind users that a file ought to be locked before the editing begins. The mechanism is a special property: svn:needs-lock. If that property is attached to a file (regardless of its value, which is irrelevant), Subversion will try to use filesystem-level permissions to make the file read-only—unless, of course, the user has explicitly locked the file. When a lock token is present (as a result of using svn lock), the file becomes read/write. When the lock is released, the file becomes read-only again.
Upvotes: 1