confused about rebase

Giorgos Keramidas keramida at ceid.upatras.gr
Mon Nov 22 14:25:46 UTC 2010


On Mon, 22 Nov 2010 07:08:54 -0500, Neal Becker <ndbecker2 at gmail.com> wrote:
>> 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
>>     |
>>     :
>
> 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:   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

You seem to have two heads now.  One with 'boost' only and another with
your own changes.  The main idea behind a vendor branch is that:

  1) you first create the vendor branch with clean snapshots of the
     upstream code

  2) you merge the vendor branch with 'default' to pull in the
     thirdparty code into the default branch

  3) you adapt the vendor code in 'default'

So you have parts of the vendor branch done, but you are missing the
'merge into default' bits.  Your history should look similar to the
following (named-branch names in [brackets] to easily 'see' the changes
of each branch):

    o      [default] local change for boost, in 'default' branch
    |
    |
    o      [default] merge of 'boost' branch into 'default'
    |\
    | \
    |  |
    |  |
    |  o   [boost]   import of clean 'boost' version 1.44.0
    |  |
    :  :

Then after the second import of boost 1.45.0 in the 'boost' branch you
should be able to see a history graph similar to:

    o      [default] more development in 'default' branch
    |
    |
    o      [default] more local changes on top of boost 1.45.0 in 'default'
    |
    |
    o      [default] new merge of boost 1.45.0 into the 'default' branch
    |\
    | \
    |  |
    |  o   [boost]   import of boost 1.45.0 into the 'boost' branch
    |  |
    o  |   [default] local change for boost, in 'default' branch
    |  |
    |  |
    o  |   [default] merge of 'boost' branch into 'default'
    |\ |
    | \|
    |  |
    |  |
    |  o   [boost]   import of clean 'boost' version 1.44.0
    |  |
    :  :

What I see in your history now is a 'boost' branch with a separate head
that lies separately from the 'default' branch.  The two should
eventually merge somehow, to pull boost sources into your default
working branch...




More information about the Mercurial mailing list