hg 0.9.3: pull, revert to pre-merged version, pull expected behavior?

Allan Wind allan_wind at lifeintegrity.com
Thu Apr 26 11:03:20 CDT 2007


Thanks Shane, and everyone else for your help and suggestions.

On 2007-04-26T09:26:36-0600, Shane Holloway wrote:
> On Apr 25, 2007, at 10:58 PM, Allan Wind wrote:
 
> >Anyways, now I want to revert to the pre-merge version (2):
> 
> I'm guessing you don't actually want to revert, which means to create  
> a changeset that reverses the change of that version, and then merge  
> it into the current head.

I reverted to 2, but there two changes since.  Perhaps that is where I
went wrong.

> What I think you want to do is try the  
> operation again.  You cannot do that from this repository because it  
> already contains the changesets recording the merge and the pull.   
> Mercurial is very conservative about not loosing changesets.  What  
> you need to do is to hg clone again to start clean.
> 
> $ cd ..
> $ hg clone -r 2 my-hello-not-cvs 2nd-hello-not-cvs
> $ cd 2nd-hello-not-cvs
> $ hg log

The scenario that I was trying explore is that you make some changes,
realize these changes were no good and want to get back to an old
version yet retain the history.  I did exactly as the above, but now you
have to keep two branches around when I really just want one.

> That is expected.  You are pulling again from the same (unchanged)  
> repository.  You current repository contains all the changes from my- 
> hello-new-output, a merged changeset 4: bb5551e150d0, and a revert  
> changeset to reverse the merge changeset.  Since it contains all of  
> these, there are now new changesets to be pulled.  The repository has  
> it recorded that they are already integrated.

I appreciate what is going on, just wondering if it is reasonable that
two working directories with the same same content should behave
differently based on history of revisions.


/Allan


More information about the Mercurial mailing list