防止推送添加到已关闭分支的提交 [英] Prevent pushing of commits that add to closed branches
问题描述
如何将Mercurial服务器配置为在其关闭后限制对命名分支的提交?我只希望存储库管理员能够重新打开分支.
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 表示可以通过变更集的额外字段中的close = 1"来标识已关闭的变更集.尚不清楚如何使用 Mercurial API 来读取变更集的额外字段.
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.
推荐答案
有一个ACL扩展与Mercurial一起分发. 您应该能够通过拒绝对除管理员以外的每个人的提交来指定冻结的分支.我不确定命名分支机构是否可以利用此功能.
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.
配置ACL:
[acl.deny.branches]
frozen-branch = *
[acl.allow.branches]
branch_name = admin
这篇关于防止推送添加到已关闭分支的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!