"push creates new remote head" issue

Just for everyone else that runs into this problem. What caused this problem for me were some local revisions on the default branch that I didn't push before I started to work on a new branch.

I had merged the latest revision I pulled for the default branch with my new branch, but these leaves your local changes to the default branch committed but un-pushed.

If you try to push them, it's not your new branch that is creating a remote head, it's the un-pushed revisions to the default branch that is creating a remote head.

When I stripped out those revision with hg strip -r 1234

hg push --new-branch 

went perfect.

What put me on the right track was

hg heads

With showed I had two heads that both had the name of the default branch with different revision numbers.


I just tried a similar setup, and I get the same warning. Apparently, although the second head you are trying to push is closed, it is seen as another head during the push. And closing both heads does not seem to be pushable either.

You can force the push, it should be ok, but you could eventually get the same issue if you keep multiple heads on your visualization branch, like you already have with changesets 14 and 20. To solve the issue once and for all, I would instead suggest to merge both changesets (14 and 20) and reclose the final head.