revert failed after undid a merge

Matt Mackall mpm at selenic.com
Sun Jul 3 20:17:02 UTC 2005


On Sun, Jul 03, 2005 at 03:24:16AM -0700, TK Soh wrote:
> 'status' reported there are changed files, when I try to undo a commited merge
> in my local hg repo (tip=591):
> 
>   $ hg up 0.6
>   $ date >> README
>   $ hg ci
>   $ hg up -m 591
>   $ hg ci
>   $ hg undo
>   $ hg revert
>   $ status
> 
> Running 'revert' again didn't do it either. Any idea what went wrong?

Nothing.

>   $ hg up 0.6
>   $ date >> README
>   $ hg ci

Ok, you've created a branch off 0.6.

>   $ hg up -m 591

Now you've merged that branch with 591. All files changed between
either branch are marked "merge". If you do status, you'll see that
a bunch of files are marked C. That's "C" relative to parent2!

>   $ hg ci

Now you've checked in your merge.

>   $ hg undo

And now you're back to where you were before the checkin.

>   $ hg revert

And now you've replaced everything in your working directory with parent1.

>   $ status

And what you see here is all the files that are different between
parent1 and parent2.


Btw, this is how you discard a dead-end head.

hg co -C # get a clean copy of the tip
hg up -m dead-branch
hg revert # revert everything that got merged back to the tip
hg commit -t "throw away changes from dead-branch"

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial mailing list