开发者

Preventing users from committing when the branch is close

Is th开发者_Go百科ere a way to prevent users from committing without using --force when a branch is closed?

Another way is to ask if I am sure I want to commit and act accordingly.

Is there such a way to do it using a hook/extension?


It should be easy to write a hook to do it: write a pre-commit hook that checks if the current parent is closed (by inspecting the "extra" changeset metadata field).

For documentation, start here: http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html. You may also want to look at the output of hg help hooks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜