Reputation: 397
I have a few applications on Perforce and each application has a few branches. Right now only the latest branch is in actual use, the old ones are there for backtracking and debugging purposes.
Is there a way that I can disable the old branches so that no one can branch/use them?
Upvotes: 1
Views: 391
Reputation: 71454
Removing permissions to them is the best option. Since you want them to remain accessible as a historical reference, but NOT permit new changes, you'll want to remove the "write" level of permission but leave the "read" level:
write user * * -//depot/oldbranch/...
read user * * //depot/oldbranch/...
If only some groups have permissions to these branches in the first place you'd need to be careful of the placement of those lines to make sure you don't accidentally grant "read" permission to the other groups; that might mean doing something more like:
write group * * -//depot/oldbranch/...
read group dev * //depot/oldbranch/...
Or you could use the "=write" syntax instead:
=write group * * -//depot/oldbranch/...
You can also use "=branch" to prevent the old branch from being used as the source for new branches (the "=branch" permission is included with the "read" level unless you explicitly exclude it like this):
=branch group * * -//depot/oldbranch/...
For more on setting up permissions: http://www.perforce.com/perforce/r15.1/manuals/p4sag/chapter.protections.html
Upvotes: 4