Problem: how move a branch back to a previous revision?

Bram Moolenaar Bram at Moolenaar.net
Sat May 15 19:38:19 UTC 2010


I wrote:

> I'm not experienced with Mercurial.  Trying to follow the documentation
> I got myself in a situation where I don't know how to get out.
> 
> For Vim there has always been the "default" branch.  This is the stable
> release.
> 
> I now started work on a new, unstable version Vim 7.3.  For that I
> created a new branch "vim73".  I submitted a few changes, so far so
> good.
> 
> Now a fix was made in the default branch: "Correct Japanese menus to
> avoid error while loading them after 7.2.432." I wanted to pick this up
> in the vim73 branch with "hg rebase".  That's where it went wrong.
> 
> Now I have the changes from the vim73 branch on top of the default
> branch.  How to I go back, revert the last few revisions that shouldn't
> be there?
> 
> You can see the current status here:
> http://code.google.com/p/vim/source/list
> 
> Specifically, these commits should not be in the default branch, they
> belong to the "vim73" branch:
> - After recovery check if the text changed. If it did mark the buffer as
>   modified.
> - Get rid of the "extra" and "lang" archives.
> - Switched from autoconf 2.63 to 2.65.
> - Small fix for compiler warning in Netbeans.
> - First step in the Vim 7.3 branch. Changed version numbers.
> 
> I tried quite a few commands I found in the docs, but nothing worked.
> Specifcally, I tried:
>           hg revert --all --rev 8a9d956f14
> Nothing happened.  Not even an error message.
> 
> How to back out a few revisions?  Can't be difficult, but how???
> Help!

Well, I found a brute-force solution:
- Delete my local repository
- Make a new clone from the server
- hg revert --all --rev 2154
- hg commit
- hg push

I don't know what happened to my local repository that made "hg revert"
ineffective.

I think I'll stay away from "hg rebase" until it's clear what went
wrong.  I can use "hg merge" instead.  Not that nice, but works.

-- 
hundred-and-one symptoms of being an internet addict:
39. You move into a new house and decide to Netscape before you landscape.

 /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///



More information about the Mercurial mailing list