the_drow
the_drow

Reputation: 19181

Preventing users from committing when the branch is close

Is there 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?

Upvotes: 3

Views: 61

Answers (1)

djc
djc

Reputation: 11731

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.

Upvotes: 2

Related Questions