Faster branch pushing

You can now push your branches to Launchpad much more quickly. That’s because Launchpad now supports stacked branches: Bazaar branches that have only a little bit of their history.

By pushing up a stacked branch to Launchpad, you push up only that little bit, rather than the full history of your project. For the code that we Launchpad developers work on – i.e. Launchpad itself – it now takes less than two minutes to push up a branch. It used to take an hour and a half.

Upgrade to Bazaar 1.7 or better

To start using stacked branches, you need to upgrade everything to Bazaar format 1.6. Upgrade your trunk, all of your branches, your local shared repositories — everything. To do this you’ll need Bazaar 1.7 or better. You can get this from the Bazaar website or from the Bazaar PPA.

Set your development focus

You’ll also need to set a development focus for your project. The development focus is the mainline branch, often called “trunk” or “devel”. You want to set it to a branch that people want to branch from a lot. If your project doesn’t have a development focus yet, there’ll be a prominent link to set it on the Code tab for that project.

Push your branch just like before and whooosh!

OK. You’ve got a dev focus and all your branches are in the new Bazaar format. All you need to do now to make a stacked branch is:

bzr push lp:~foo/bar/baz

That is, you just push the way you always do and then watch the speed.

What happens is that Launchpad hints to Bazaar that new branches should be stacked on the development focus. Bazaar follows that hint and stacks the new branch appropriately. It then only sends up the revisions that are in the new branch but not in trunk.

This is why you want to set your development focus to a branch that’s going to be branched from and merged to a lot: the time it takes to push up a new branch is proportional to how different that branch is from your development focus.

A lot of work has gone into this feature (particular thanks to Michael Hudson and basically all of the Bazaar core devs), I hope you enjoy it!

3 Responses to “Faster branch pushing”

  1. Launchpad News Says:

    […] Jono’s blog post for more […]

  2. tonghaowu Says:

    thank you

  3. Jesse Says:

    Where is this hinting done? In the launchpad plugin or when pushing through the bzr+ssh transport? This behavior doesn’t seem to be clearly documented. And there doesn’t seem to be an option to explicitly disable stacking

Leave a Reply