HG rebase is here!

15 views
Skip to first unread message

Atul Varma

unread,
Jan 14, 2009, 7:16:25 AM1/14/09
to ubiqui...@googlegroups.com
Hey, I was just checking up on the status of HG and discovered that at
the end of December, a new stable version of HG supporting the 'rebase'
extension was released. If you use the rebase extension, this means no
more pointless merges!

Getting it set up was a bit more annoying than I'd hoped, but it wasn't
too bad. If you're on Windows or OS X, I recommend just getting a
precompiled binary:

http://mercurial.berkwood.com/

(FWIW, I actually just tried "sudo easy_install -U mercurial" on my OS X
machine, but ran into an annoying dependency error with setuptools that
forced me to do "sudo easy_install -U setuptools" and then delete the
two old versions of setuptools that were already on my system. Not very
fun, but I suspect that other folks with OS X won't want to go through
the same hassle.)

Once you've upgraded, you'll have to tell HG that you want to use the
rebase extension. Edit your ~/.hgrc file and under the "[extensions]"
section, add a line that says "rebase =". For instance, right now my
.hgrc contains:

[ui]
username = Atul Varma <my email address>
editor = /usr/bin/emacs

[extensions]
fetch =
hgext.mq =
rebase =

Then, whenever you normally run into a situation that normally requires
a merge, e.g.:

pulling from http://hg.toolness.com/ubiquity-firefox
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)

Instead of running 'hg merge' here, just run 'hg rebase'. You should
get something like this:

saving bundle to
/Users/varmaa/ubiquity-firefox/.hg/strip-backup/12f786c75700-temp
adding branch
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
rebase completed

Then if you do an "hg log", it should show a nice, clean log that
doesn't involve any automated merge spam.

In cases where there were legitimate merge conflicts during the rebase,
Mercurial will bring up your merge tool (as if you'd done an "hg merge")
and wait for you to resolve conflicts with it before completing the rebase.

Since it's really easy to make multiple clones of your ubiquity-firefox
repository on your machine, if you're at all confused about how this
might work out in practice, I recommend making some throwaway clones of
your repo and playing around with trivial changes and rebasing.

I've also upgraded to 1.1.2 on labs.toolness.com, which features a much
better web interface for repository browsing. It also includes a nifty
"graph" view:

http://hg.toolness.com/ubiquity-firefox/graph/tip

If you have any questions, feel free to reply to this post.

- Atul

Reply all
Reply to author
Forward
0 new messages