howto suspend work

Martin Geisler mg at lazybytes.net
Wed Jun 3 17:00:45 CDT 2009


On Wed, Jun 3, 2009 at 21:42, Neal Becker <ndbecker2 at gmail.com> wrote:
> Martin Geisler wrote:
>
>> On Wed, Jun 3, 2009 at 20:03, Neal Becker <ndbecker2 at gmail.com> wrote:
>>
>>> hg ci -m 'newer stuff based on revA'
>>> added 1 head
>>>
>>> OK, great.  Now I have 2 heads.  Now what?  I sure don't want to do
>>> merge, that would pull in the changes from 'experimental deadend'.
>>
>> You write that you would like to keep the changes to preserve the
>> deadend (it can be nice to show it to others in the future).
>>
>> To do this you can do a dummy-merge where you merge the two heads
>> *but* throw away all changes that come from the deadend experiment.
>> This is done as follows:
>>
>>   HGMERGE=true hg merge
>>   hg revert --all --rev other-head
>
> Just to clarify, that 'other-head' is the head that I _don't_ want?

Good that you asked -- it's the other way around :-)

So 'other-head' is the head you want to keep. The idea is that you
start with the two heads, calls them 'other-head' and 'deadend-head'.
You merge and now have a working copy with two parents. You want to
commit a working copy which is exactly like the good head -- this will
communicate to the world that:

  "the right way to combine 'deadend-head' and 'other-head' is to make
a working copy that is just like 'other-head', i.e., to throw away
'deadend-head'."

You do that by reverting the working copy to 'other-head' and
committing, thereby finishing the dummy merge.

-- 
Martin Geisler



More information about the Mercurial mailing list