0

How can I configure a Mercurial repo to reject any push that would result in a multiheaded branch?

As a follow up, how can I configure a clone to always pull before a commit, so hg can warn if the commit will result in a multiheaded branch, so the user can either abort or know that they must merge / rebase after the commit?

XDR
  • 4,070
  • 3
  • 30
  • 54
  • 1
    For enforcing single head locally or on a server, set `experimental.single-head-per-branch = True` in your hgrc. In your case, you need to set it on server. – Pulkit Goyal Jun 03 '18 at 12:30
  • Thanks for the tip. I’m using bitbucket.com, and I don’t think I can manually edit the `.hg/hgrc` there. Do you know a way to do this on bitbucket? – XDR Jun 03 '18 at 14:05
  • Why don't you add the bitbucket constraint explicitly to your question (and tag it as such) – StayOnTarget Jun 04 '18 at 11:44
  • @XDR sorry, I don't know of a way you can enable this on bitbucket. You can also enable this locally everywhere so that you don't create multihead branch locally and hence preventing from pushing one. – Pulkit Goyal Jun 04 '18 at 11:56

0 Answers0