git rebase - can hg do that ?

Brendan Cully brendan at kublai.com
Mon Jun 11 00:20:51 CDT 2007


On Saturday, 02 June 2007 at 02:23, David Jack Olrik wrote:
>
> On 31/05/2007, at 22.38, John Goerzen wrote:
>
>> On 2007-05-29, Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
>>> On 2007-05-29 20:42, David Jack Olrik <david at olrik.dk> wrote:
>>>> On 29/05/2007, at 16.26, Giorgos Keramidas wrote:
>>>>> MercurialQeueus can do that, and it works nicely for local patch queues:
>>>>
>>>> Mq looks nice, but is a bit more work than just writing 'hg rebase 
>>>> <branch>'
>>>
>>> Indeed.  I haven't really tried MqMerge with the "in repository"
>>> branches of Hg.  Things may be easier or tougher... I don't know yet.
>>
>> hg transplant does exactly what you want, and it works with 0.9.3
>
> Actually it doesn't, according to the docs it does the following:
>
> "Selected changesets will be applied on top of the current working directory 
> with the log of the original changeset."
>
> This is not what I want.
>
> Before rebase:
>                  A---B---C topic
>                 /
>            D---E---F---G upstream
>
> After rebase:
>                          A'--B'--C' topic
>                         /
>            D---E---F---G upstream
>
> What I want is my topic branch to be updated with the changes from upstream, 
> with my changes applied on top (i.e. remove my changes from the branch, 
> update id, and re-apply my changes), not the other way around.
> 
> If 'hg transplant' really can do this could someone show me the actual 
> command to do it ?

hg up -C G
hg branch -f topic
hg transplant -a -b topic

it's almost as easy with mq:

hg qimport -r A:C
hg qpop -a
hg up G
hg branch topic
hg qpush -a
hg qdel -r qbase:qtip

with the transplant version, you can transplant patches from people
who have committed to the old branch, and transplant will know where
to start.


More information about the Mercurial mailing list