How to abandon a hg merge?

Grumdrig picture Grumdrig · Apr 3, 2010 · Viewed 79.4k times · Source

I'm new to collaborating with Mercurial. My situation:

  • Another programmer changed rev 1 of a file to replace 4-space indents with 2-space indent. (I.e. changed every line.) Call that rev 2, pushed to the remote repo.
  • I've committed substantive changes rev 1 with various code changes in my local workspace. Call that rev 3.
  • I've hg pulled and hg merged without a clear idea of what was going on.
  • The conflicts are myriad and not really substantive.

So I really wish I'd changed my local repo to 2-space indents before merging; then the merge will be trivial (i'm supposing). But I can't seem to back up. I think I need to hg update -r 3 but it says abort: outstanding uncommitted merges.

How can I undo the merge, changes spacing in my local repo, and remerge?

Answer

math picture math · Jun 1, 2010

BTW: if you just revert the merge you did and 3 is not your revision number you can do this:

hg update -C -r .