[IPython-dev] Bazaar on OS X

Stéfan van der Walt stefan@sun.ac...
Mon Jun 30 01:06:34 CDT 2008


2008/6/30 David Cournapeau <cournapeau@cslab.kecl.ntt.co.jp>:
> bzr emphasizes the current branch (mainline) as special. That's the
> fundamental difference between bzr and hg/git here. In git and hg, what
> happens when you merge a branch is that you 'append' the new revisions
> to the DAG. It means you have a flat log, and you can see every commit
> at the same level:
>
>   /------B ----- C ------\
> A -                        -----> merge -> F
>   \------D ------ E -----/

Knowing that bzr preserves the mainline, looks like you did:

 /------B ----- C -------.------> merge -> F
A -                       /
 \------D ------ E ------/

Otherwise you get something like:

------------------------------------------------------------
revno: 2
committer: Stefan van der Walt <bzr@mentat.za.net>
branch nick: bzrtest
timestamp: Mon 2008-06-30 07:25:43 +0200
message:
  Merge dev branches.
    ------------------------------------------------------------
    revno: 1.2.2
    committer: Stefan van der Walt <bzr@mentat.za.net>
    branch nick: bzrtest1
    timestamp: Mon 2008-06-30 07:24:39 +0200
    message:
      C
    ------------------------------------------------------------
    revno: 1.2.1
    committer: Stefan van der Walt <bzr@mentat.za.net>
    branch nick: bzrtest1
    timestamp: Mon 2008-06-30 07:24:31 +0200
    message:
      B
    ------------------------------------------------------------
    revno: 1.1.2
    committer: Stefan van der Walt <bzr@mentat.za.net>
    branch nick: bzrtest2
    timestamp: Mon 2008-06-30 07:24:57 +0200
    message:
      E
    ------------------------------------------------------------
    revno: 1.1.1
    committer: Stefan van der Walt <bzr@mentat.za.net>
    branch nick: bzrtest2
    timestamp: Mon 2008-06-30 07:24:50 +0200
    message:
      D
------------------------------------------------------------
revno: 1
committer: Stefan van der Walt <bzr@mentat.za.net>
branch nick: bzrtest
timestamp: Mon 2008-06-30 07:22:17 +0200
message:
  A

(I just merged both branches at the same time)

`pull` and `push` should only be used when you want to create an exact
copy of another branch.  It has the effect of flattening out the log,
so I'd imagine it is a bad idea to "force" through merges that way.

> Concerning history folding, it can become really ugly when you work on
> several branches at the same time and need to merge one from the other
> (typically, I encountered this in the following quite usual scenario:
> start a feature branch, then see a bug in this branch, fix the bug in
> another branch, and then merge the fix into mainline and merge mainline
> into feature branch). You can do with rebase, but it does not work that
> well with bzr (I think this is because contrary to git, which
> essentially guesses everything, bzr uses a lot of meta-data; again, this
> has advantages and disadvantages); and rebase has its own problem, too.
> There is no win-win scenario that I am aware of.

Do you know whether other systems try to work around this, and how they do it?

Here is what I see under bzr:

$ bzr log
------------------------------------------------------------
revno: 3
committer: Stefan van der Walt <bzr@mentat.za.net>
branch nick: bzrtest
timestamp: Mon 2008-06-30 07:55:32 +0200
message:
  Merge changes from interface branch into mainline.
    ------------------------------------------------------------
    revno: 1.2.3
    committer: Stefan van der Walt <bzr@mentat.za.net>
    branch nick: bzrtest_interface
    timestamp: Mon 2008-06-30 07:55:14 +0200
    message:
      Make some more changes to the interface branch.
    ------------------------------------------------------------
    revno: 1.2.2
    committer: Stefan van der Walt <bzr@mentat.za.net>
    branch nick: bzrtest_interface
    timestamp: Mon 2008-06-30 07:54:33 +0200
    message:
      Merge changes from mainline with the interface branch.
    ------------------------------------------------------------
    revno: 1.2.1
    committer: Stefan van der Walt <bzr@mentat.za.net>
    branch nick: bzrtest_interface
    timestamp: Mon 2008-06-30 07:54:06 +0200
    message:
      Checkin to improve the calculator interface. Branch: interface.
------------------------------------------------------------
revno: 2
committer: Stefan van der Walt <bzr@mentat.za.net>
branch nick: bzrtest
timestamp: Mon 2008-06-30 07:53:24 +0200
message:
  Merge in calculator engine fixes into "mainline".
    ------------------------------------------------------------
    revno: 1.1.1
    committer: Stefan van der Walt <bzr@mentat.za.net>
    branch nick: bzrtest_addition
    timestamp: Mon 2008-06-30 07:53:10 +0200
    message:
      Fix addition in calculator.  Branch: addition.
------------------------------------------------------------
revno: 1
committer: Stefan van der Walt <bzr@mentat.za.net>
branch nick: bzrtest
timestamp: Mon 2008-06-30 07:52:31 +0200
message:
  Project root is here. It is a fake pocket calculator.

I don't see any history folding as such; I *do* see a log message
saying that I committed changes from the main branch into the addition
branch, but those changes *themselves* were not re-merged with
mainline.

> I think what Brian said is really important (you never the nice things
> of the tools you are using, you never see the bad things of the tools
> you are not using). The only way is to use the tools on a daily basis.

That's true.  I am trying to understand these issues, so that I can
tell whether the "bad things" I see are due to the tool or my abuse of
it.

Cheers
Stéfan


More information about the IPython-dev mailing list