Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent pushing of commits that add to closed branches

How can I configure a Mercurial server to restrict commits to a named branch once it has been closed? I only want the repository administrator to have the ability to reopen the branch.

https://www.mercurial-scm.org/wiki/PruningDeadBranches says that closed changesets can be identified by "close=1 in the changeset's extra field". It's not clear how to read a changeset's extra field using the Mercurial API.

like image 450
Gili Avatar asked Oct 18 '10 17:10

Gili


1 Answers

There is an ACL extension that is distributed along with Mercurial. You should be able to specify the frozen branches by denying commit to every one except the administrator. I am not sure if named branches can leverage this facility.

  • https://www.mercurial-scm.org/wiki/AclExtension

Configuring acls:

[acl.deny.branches] 
frozen-branch = *

[acl.allow.branches]
branch_name = admin
like image 81
pyfunc Avatar answered Oct 18 '22 17:10

pyfunc