confused about rebase

Neal Becker ndbecker2 at gmail.com
Mon Nov 22 06:08:54 CST 2010


Giorgos Keramidas wrote:

> On Sun, 21 Nov 2010 17:37:02 -0500, Neal Becker <ndbecker2 at gmail.com>
> wrote:
>> I have boost_1_44_0.dist which is the upstream hg repo
>> I have boost_1_44_0.hg which is the upstream, with my patches added.
>>
>> I updated to boost_1_45_0.dist by:
>> <extract tar file to new dir boost_1_45_0.dist>
>> cp -al boost_1_44_0.dist/.hg* boost_1_45_0.dist
>> cd boost_1_45_0.dist
>> hg addremove
>> hg ci
>>
>> everything looks good - I have a boost_1_45_0.dist matching upstream
>>
>> Now
>> cp -al boost_1_45_0.dist boost_1_45_0.hg
>> cd boost_1_45_0.hg
>> hg pull --rebase ../boost_1_44_0.hg  <<< pull in my patches
> 
> What does 'hg glog --limit 10' show here?  You should see your old
> boost_1_44_0.dist history, with your boost_1_44_0.hg local commits as
> one head, and then a new head with the boost_1_45_0.dist commit, e.g.:
> 
>     @    12     466b9a02640c   2010-11-07 13:07 +0100   ndbecker2
>     |      import boost 1.45.0 sources
>     |
>     | o  11     77fb285a2e35   2010-11-05 09:13 +0100   ndbecker2
>     | |    local patches on top of boot 1.44.0
>     | |
>     | |
>     |/
>     |
>     o    10    5b331fa555a7   2010-11-05 08:39 +0100   gkeramidas
>     |      import boost 1.44.0 sources
>     :
>     :
> 
> When you have two heads like these, you can rebase the changes from
> 11:77fb285a2e35 on top of the new boost import.
> 
> Note that for vendor sources like these, I'd probably *AVOID* rebase
> though.  You lose merge history when you rebase the local patches on top
> of newer releases of boost.
> 
> For thirdparty sources like boost, I'd probably use "hg merge"
> repeatedly and aim for a history like this:
> 
>     o       merge of local changes with boost-1.45
>     |\
>     | \
>     |  |
>     o  |     import of boost 1.45.0
>     |  |
>     |  |
>     |  o     local changes on top of boost 1.44.0
>     |  /
>     | /
>     o'       import of boost 1.44.0
>     |
>     :
> 
> This way you can 'see' later on when the merge of 1.45.0 was done, who
> did it, what changes they committed to merge the local version of boost
> with the upstream vendor source, etc.
> 
> The left-hand side of the graph above is essentially a 'vendor branch',
> tracking the upstream releases.  You can even use a *named* branch for
> this, by importing the original boost-1.44.0 sources in a 'boost'
> branch.  Then you can keep importing the boost releases into the 'boost'
> branch and merging the new releases into your 'default' branch, e.g. by:
> 
>     # import a new snapshot of the boost sources in the boost branch
> 
>     hg update --clean boost
>     rm -fr lib/boost
>     tar xzvf /tmp/boost-1.45.0.tgz && mv boost-1_45_0 lib/boost
>     hg addremove lib/boost
>     hg commit -m 'Import boost 1.45.0 release'
> 
>     # merge the boost release into the default branch
> 
>     hg update --clean default
>     hg merge boost
>     hg commit -m 'Merge boost 1.45.0 into mainline'

I like this last idea of a named branch for vendor.  I copied my upstream 
repo, created a named branch 'boost', then switched to default, and imported 
each of my patches.  Now I have the following, does this look correct?

hg glog
@  changeset:   13:8a5da4b0b1f5
|  tag:         tip
|  user:        ndbecker2 at gmail.com
|  date:        Mon Nov 22 07:00:10 2010 -0500
|  summary:     vector
|
o  changeset:   12:166008a04f24
|  user:        ndbecker2 at gmail.com
|  date:        Mon Nov 22 06:59:59 2010 -0500
|  summary:     user-config
|
o  changeset:   11:2f084a55eefd
|  user:        ndbecker2 at gmail.com
|  date:        Mon Nov 22 06:59:49 2010 -0500
|  summary:     traits
|
o  changeset:   10:624811b2a949
|  user:        ndbecker2 at gmail.com
|  date:        Mon Nov 22 06:59:40 2010 -0500
|  summary:     multiarray
|
o  changeset:   9:5fff8d6381a2
|  user:        ndbecker2 at gmail.com
|  date:        Mon Nov 22 06:59:32 2010 -0500
|  summary:     mersenne
|
o  changeset:   8:fec2605eae95
|  user:        ndbecker2 at gmail.com
|  date:        Mon Nov 22 06:59:19 2010 -0500
|  summary:     hgignore
|
o  changeset:   7:7bbe59af58e0
|  user:        ndbecker2 at gmail.com
|  date:        Mon Nov 22 06:58:52 2010 -0500
|  summary:     BUILD
|
o  changeset:   6:dd180aedb17f
|  parent:      4:e7369384ef30
|  user:        ndbecker2 at gmail.com
|  date:        Mon Nov 22 06:58:33 2010 -0500
|  summary:     constrained_value
|
| o  changeset:   5:50e61dee07be
|/   branch:      boost
|    user:        ndbecker2 at gmail.com
|    date:        Mon Nov 22 06:44:00 2010 -0500
|    summary:     made vendor branch 'boost'
|
o  changeset:   4:e7369384ef30
|  user:        ndbecker2 at gmail.com
|  date:        Sun Nov 21 16:56:42 2010 -0500
|  summary:     update to 1.45.0
|
o  changeset:   3:aa67a6883458
|  user:        ndbecker2 at gmail.com
|  date:        Fri Aug 13 19:46:05 2010 -0400
|  summary:     update to 1.44.0
|
o  changeset:   2:9f6bc3465b4f
|  user:        ndbecker2 at gmail.com
|  date:        Wed May 05 17:07:06 2010 -0400
|  summary:     update to 1.43.0
|
o  changeset:   1:b816579cd3f6
|  user:        ndbecker2 at gmail.com
|  date:        Wed Feb 24 19:41:40 2010 -0500
|  summary:     update to 1.42.0
|
o  changeset:   0:c6dde043ee33
   user:        ndbecker2 at gmail.com
   date:        Wed Nov 18 18:41:53 2009 -0500
   summary:     init 1.41.0




More information about the Mercurial mailing list