[IPython-dev] Bzr workflow heads-up

Fernando Perez fperez.net at gmail.com
Sat May 31 22:12:08 EDT 2008


Hi all,

Ville recently pointed out to me that  some of us were mis-using bzr
in our normal workflow.  This is something some of you may remember
discussing at the March sprints, where we'd concluded that launchpad
just had a crappy web view of the history, since it only shows a
single branch, with the effect that whoever made the last commit
appeared to overwrite the project history.  In reality no commit
history was ever lost, as a local 'bzr viz' would show you, but the
publicly visible history was indeed mangled.  For example if you see
here:

https://code.launchpad.net/~ipython/ipython/stable-dev

revision 122 appears as a single commit from Ville, which in my local
copy actually consisted of multiple independent commits, and he was
undoing this 'folding of history' effect that occurred when I pushed
those changes upstream.

The origin of the problem was that I was working directly on the
branch I obtained via

bzr branch lp:ipython

and doing *both* commits and pushes from there.  While that doesn't
cause bzr itself any problems, it does confuse the web view that
launchpad uses, since that one flattens the bzr history into a single
line of development (bzr viz does show the full branch/merge evolution
correctly).

Since it's nice to make sure that the public web view remains a more
faithful representation of the actual commit history, and it is
possible to accomplish it with very little extra effort, here's the
required procedure (I'll put this on the wiki as well).  If you are an
ipython developer with push rights to one of the public project
branches  (I'll use the main one here, but the same applies to all),
the workflow you should use is:

1. Make a local copy of the public branch with:

bzr branch lp:ipython ipython-launchpad

You will NOT work on this branch directly!

2. Make a SECOND branch off of this one (you can repeat the lp branch
with a second name, but it's faster to do this locally):

bzr branch ipython-launchpad ipython-local


3. The -local one is where you will do all your work, make local
commits, etc.  As you work in -local, you can make as many commits as
you want, pull from launchpad (to get the changes from other
developers), etc.  But you will NEVER push back up to launchpad from
here.

4. Once you are ready to push your work back up to launchpad to the
main branch, in the -launchpad branch, do (this assumes the two sit
next to each other):

   bzr pull ../ipython-local
   bzr push

(the first time you'll need the full path and the --remember option).
This will then ensure that  the revision history from your -local
branch is merged in correctly with the rest of the changes made by
other developers.


Note: I've now tried the above approach for the small changes I made
for 0.8.4 and it worked fine.  But I don't know all the details and
there may be things in the above description that are not 100% right
or could be done better/easier.  If that's the case, please update the
wiki, I put all this here for permanent reference:

http://ipython.scipy.org/moin/Developer_Zone/Developer_Guidelines


Cheers,

f



More information about the IPython-dev mailing list