howto suspend work

Neal Becker ndbecker2 at gmail.com
Wed Jun 3 14:42:06 CDT 2009


Martin Geisler wrote:

> On Wed, Jun 3, 2009 at 20:03, Neal Becker <ndbecker2 at gmail.com> wrote:
>> Neal Becker wrote:
>>
>>> I have reached a milestone, let's call it revA.  I started working on
>>> some substantial change, but then realized this is not the right
>>> approach.  I could just hg revert (I haven't yet committed these new
>>> changes), but I'd like to keep it just in case.
>>>
>>> I could hg ci the new changes, and then hg update -r revA.  That's fine,
>>> except the head would still be the aborted experiment.
>>>
>>> Suggestions?
>>
>> OK, so here's what I tried.
>>
>> hg ci -m 'experimental deadend'
>>
>> hg update -r revA.
>>
>> hack hack
>>
>> 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?

>   hg commit -m "This was a deadend (dummy merge)."
> 
> where other-head is the head you want to keep. Setting HGMERGE to true
> will signal to Mercurial that all conflicts were resolved fine -- they
> wont matter since we throw them away with the revert step.
> 
> This is the easiest way in the sense that the deadend will be
> communicated to other clones using the normal mechanisms (push/pull)
> and so others wont have to do anything special to see it and to
> discover that it has been thrown away.
> 
> If you want to remove the deadend from your clone you can do so
> without extensions, too. Simply use the --rev argument to 'hg clone':
> 
>   hg clone --rev other-head . ../without-deadend
> 
> Then without-deadend will be a repository which contains other-head
> and its ancestor changesets only. You can specify multiple --rev
> arguments if you need to preserve several changesets in the new clone.
> You can then delete or backup the repository that still has the
> deadend.
> 





More information about the Mercurial mailing list