rebase howto

Giorgos Keramidas keramida at ceid.upatras.gr
Thu Jan 29 20:02:15 UTC 2009


On Thu, 29 Jan 2009 10:58:29 -0500, Neal Becker <ndbecker2 at gmail.com> wrote:
>Giorgos Keramidas wrote:
>> This is probably not the answer you are looking for, but why don't you
>> keep both releases and merge?
>>
>>     1) import a "clean" vendor copy of boost_1_37_0
>>
>>     2) import a "clean" vendor copy of boost_1_38_0_beta1 on top of it,
>>        maybe using addremove --similarity to try to 'guess' renames
>>
>>     3) clone the first import with `hg clone -r 0 vendor mine'
>>
>>     4) patch your boost_1_37_0 working clone with any local changes
>>
>>     5) pull from ../vendor the boost_1_38_0_beta1 changes
>>
>>     6) merge
>
> Here's what I did:
>
> I start with:
> boost_1_37_0.dist (upstream imported to hg)
> boost_1_37_0.hg (includes my patches)

Ah, I didn't realize there was a `.dist' clone with clean imports ;)

> I do:
> cp -al boost_1_37_0.dist boost_1_38_0_beta1.dist (copy old tree with hg
>   stuff)
> tar xjf boost_1_38_0_beta1.tar.bz2 (overwrite with new upstream)

It may be useful to make sure the workspace has no files before
extracting the tarball.  This way if the vendor removes a file hg will
record a delete operation for it when you addremove.

> cd boost_1_38_0_beta1.dist
> hg addremove; hg ci -m 'update to ...'
> cp -al boost_1_38_0_beta1.dist boost_1_38_0_beta1.hg (clone to my new merged
>   version)
> cd boost_1_38_0_beta1.hg
> hg pull --rebase ../boost_1_37_0.hg/
>
> Seems to have worked

Nice :)



More information about the Mercurial mailing list