hg transplant, rebasing, and merging

Benjamin Smedberg benjamin at smedbergs.us
Fri Feb 22 18:15:15 CST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dirkjan Ochtman wrote:
| Benjamin Smedberg wrote:
|> In both cases, what people keep saying they could use is a mercurial
|> implementation of 'git rebase'... where you can move a commit to a new base,
|> with merging, and you can reorder commits with merging.
|
| Is there a reason you want to use transplant rather than mq? It seems mq
| would be the straightforward solution here. For your second use-case,
| the recently proposed qup command would help.

I have used mq to perform these tasks, but it is pretty painful. To rebase a
branch:

hg qsave -e -c
hg up -C tip
hg qpush -m... repeat Npatches
hg qpop -a -n patches.N

To reorder patches:

hg qsave -e -c
hand-edit .hg/patches
hg up -C qparent
hg qpush -m... repeat Npatches
hg qpop -a -n patches.N

Other than "you can do it", why is either of these sequences preferable to a
rebase command that does the necessary manipulations directly?

- --BDS

- --

Benjamin Smedberg
Platform Guru
Mozilla Corporation
benjamin at smedbergs.us
http://benjamin.smedbergs.us/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHv2WTSSwGp5sTYNkRAt7XAJ408oOBfWzhkqbjN4bYXCrrBy7NrACeOiSn
NDXY4e+gu/NRaL+mOsJs/Q8=
=BUVg
-----END PGP SIGNATURE-----


More information about the Mercurial mailing list