removing an accidentally merged branch

Harvey Chapman hchapman-hg at 3gfp.com
Tue Jun 15 15:27:00 UTC 2010


On Jun 15, 2010, at 11:06 AM, David Dyer-Bennet wrote:
> On Tue, June 15, 2010 09:55, Harvey Chapman wrote:
>> How do I permanently get rid of rev 689?
>> 
>> o  changeset:   692:99482322f98b
>> |               Adding /dev/hd* and /dev/sd* mdev debugging.
>> o    changeset:   691:4010971da1bf
>> |\                Use a sequence number with mdev so partition table
>> reloading will
>> | |  		work correctly.
>> | o  changeset:   690:66b7f25a8807
>> | |               Logging hasn't been optional for a while. Turn off the
>> check which
>> | |  		could have become a bug.
>> o |  changeset:   689:6da837a7ff67
>> |/                Logging hasn't been optional for a while. Turn off the
>> check which
>> |    		could have become a bug.
>> o  changeset:   688:df2de96239ce
>> |               Add .DS_Store mac file to ignore
> 
> This looks like a case for "hg backout" (followed by another merge).

That wouldn't work because I need 689 to never have existed. However, I figured out how to do this. I was using qimport incorrectly because I get confused by qimport's different -r syntax from the rest of mercurial.

hg qimport -f -r tip:692          # rev right before merge
hg qpop -a                        
hg export -r 691 -g >> 691.diff   # Save the merge rev.
hg strip 691                      # Remove the merge rev and 689. (Yes!)
hg strip 689
# Edit 691.diff and remove the "689:6da837a7ff67" parent.
hg import 691.diff                # Put the non-merge version of 691 back.
hg qpush -a                       # Put 692 and above back.
hg qfinish -a                     # Problem solved. Now remember this the next time you decide to be
                                  # clever with rebase.






More information about the Mercurial mailing list