0
votes

I had cloned the repository from the default (only) branch. Did a lot of work on it with many commits. I finally wanted to push the current changes as a separate development stream back to the repository. So I did a hg branch 8-2-. Pulled what was currently on the repository (still only the default branch). Merged the changes to my stuff. Now, when I attempt to do hg push --new-branch, I still get the multiple heads warning:

abort: push creates new remote head 57550f12d0f6! (did you forget to merge? use push -f to force)

Did a hg heads:

changeset: 132:8ab701e45e38 branch: 8-2- tag: tip parent: 131:3f2c30e8396d parent: 129:a45e28d1ef1b user:
Vance Neff date: Mon Aug 06 14:55:14 2012 -0400 summary: merge unexpected head

changeset: 129:a45e28d1ef1b user: Vance Neff date: Thu Aug 02 14:15:08 2012 -0400 summary: Added tag 8-1-29 for changeset 7d88ac157486

changeset: 113:57550f12d0f6 user: Vance Neff date: Thu Aug 02 18:29:32 2012 -0400 summary: Added tag 8-2-29 for changeset 4ab1691d7120

I see that the offending head is the last commit just before I did the hg branch 8-2-, changeset 113.

How do I resolve this? Note: I have read all the warnings concerning using named branched here. Too late.

Thanks Vance

1

1 Answers

1
votes

I can’t see exactly what you did there and the current state of your repository, but it looks like you need to merge the two changesets on default together.

hg update 129
hg merge 113
hg commit -m "merge"

After that you will only have one head on default again and all is well.

Alternatively, you can use the strip command to remove all your (un-pushed) changes that went wrong. Then you can redo them. Note, make sure only to strip changesets appearing in hg outgoing so that you don’t remove any public changesets.

Tip: when I don’t feel confident about a command I’m about to run, I usually make a clone or copy of the repository before executing it, so that I can always easily revert back to the original state. One of the blessings of DVCS :).