Search code examples
version-controlmercurialbranchtortoisehgbranching-and-merging

Mercurial - abandoning loose ends


Due to lack of attention, I have made a rollback ("backout") that I had forgot to merge back into the default branch - which I did not notice until a bit later, causing my local history to look like this:

http://i.imgur.com/mDKdSbj.png

Which seems to disallow pushing ("new remote heads").

If I select that loose branch end choose "update", it will split off the commits made afterwards

enter image description here

And if I select the new loose end and "update", we're back where we started.

http://i.imgur.com/mDKdSbj.png

How do I resolve this? (Using the HgWorkbench, btw.)

As I had forgotten about the backout, one of the later commits actually did what the backout was supposed to do, so I'd be perfectly fine with simply chopping off the obsolete branch, but I have no idea how to go about this.


Solution

  • With TortoiseHg, enable either the strip or mq extension via File, Settings, global settings tab, Extensions. Then right-click the obsolete changeset, Modify History, Strip... will remove the changeset, assuming it hasn't been pushed yet.