How can I forbid commits and allow merges into specific branch?
eg. master branch can't be complete with a commit but can with merge.
How can I forbid commits and allow merges into specific branch?
eg. master branch can't be complete with a commit but can with merge.
If you want to allow only merges in a branch, check in the hook whether every commit for that branch has two parents - and reject the incoming changes if it has only one.
Based on @planetmaker's idea I found a hook what can help me: https://www.mercurial-scm.org/wiki/HookExamples#pretxnchangegroup:_enforce_the_stable_branch_to_contains_only_merge_commits_on_the_server