views:

59

answers:

3

In the days before a release we'd like to be able to prevent developers from committing files to the SubVersion branch, unless a team leader has reviewed and approved the changes (in which case they would make a temporary change to allow this).

Previously we used ClearCase, in which this was relatively easy to do.

Since the svn:lock command only works on a per-file basis, we are uncertain if we can emulate this behaviour in SubVersion.

What do you do?

+1  A: 

You can have a look at GUI svn clients which usually have richer interface/functionality set than a command line one. For example, I'm using TortoiseSVN which has options Get Lock/Release Lock applicable for locking all files in the selected folder recursively. BTW, it also has convenient option of making tag/branch and switching to it as one action.

Pmod
This response best answers my question, however the get/release lock mechanism is pretty slow, since it recursively makes the change on all files. Therefore I am not sure we will actually use this approach.
Richard Ev
Right, we use svn repository in our work extensively and don't use locking. We have conventions on trunk/tags/branches, so nobody commits to tags; we make only bug fixes in release branch and the whole activity on project can be easily seen through WebSVN.
Pmod
+1  A: 

You can add a pre-commit hook on the server, which checks if the commit target contains closed branches, and maybe a keyword in the log message to bypass this check.

Rudi
+4  A: 

Laterally thinking - why not just create a branch at the point at which you want to 'lock' it and only check out that revision number in your build/release process.

Then developers can still check-in to the trunk (or whatever other branch they're working on) and if a team leader approves changes for the release then they can be merged into the branch. Granted this doesn't actually 'lock' the release branch but at least you can easily track/undo changes if necessary and it doesn't prevent people working. The developers source will still be pointing to the branch/trunk they were working on rather than the new release branch.

Creating branches is very cheap and easy in SVN (I believe).

shunty