Contribute > Development > DVCS Workflows > Bazaar

  1. For Twisted contributors
    1. Shared repository
    2. Launchpad's mirror - trunk only
    3. Twisted's mirrors - all branches
    4. Work on your patch
    5. Keeping up-to-date
  2. For Twisted core developers
    1. Committing a Bazaar branch to a Subversion branch
    2. Committing a Bazaar branch to trunk

The Twisted codebase is mirrored into a set of Bazaar branches for those developers who prefer to use bzr instead of svn. This page explains how you can get copies of these branches. In the following directions, ~/Projects/Twisted is used as an example of a directory where your Twisted code is stored; you can replace it with any other directory.

For other version control systems, see DVCS Workflows.

For Twisted contributors

If you want to develop a patch for Twisted (as described in the BasicGuideToContributingCode) but prefer to use Bazaar rather than SVN, this is the section for you.

Shared repository

Use Bazaar 2.0 or later

When branching Twisted, it's recommended to create your local branch inside of a Bazaar "shared repository". A shared repository is a directory on your filesystem that you create bazaar branches within. When a bazaar branch is created within a shared repository, all of the revision data is shared inside the repository, instead of being stored independently in each branch. This makes further branching from the network much faster, and saves disk space. The following command should create a proper repository:

bzr init-repo ~/Projects/Twisted

You must use Bazaar 2.0.0 or newer.

Launchpad's mirror - trunk only

Launchpad provides a mirror of Twisted trunk only. It can be fetched with the following command:

cd ~/Projects/Twisted
bzr branch lp:twisted

Twisted's mirrors - all branches

We provide mirrors of *all* the branches of Twisted, so if you need something other than trunk, you can get it. They are available under For example, to get trunk:

cd ~/Projects/Twisted
bzr branch

Or a branch named "fix-bug-1234":

cd ~/Projects/Twisted
bzr branch

Work on your patch

(hack hack hack)

# Make sure the test suite passes
trial twisted

# Local commit
bzr commit

# Generate a patch
bzr send -o - > my.patch

Attach my.patch to the ticket in trac and add review to Keywords

Keeping up-to-date

Once someone has reviewed your patch, you will want to update your bzr repo and make sure it still cleanly applies to trunk or the branch you are working on, and deal with any merge conflicts.

bzr up

For Twisted core developers

If you are a Twisted developer and want to use Bazaar, this section is for you.

Committing a Bazaar branch to a Subversion branch

Doing this, of course, requires bzr-svn.

To create a Subversion branch from a Bazaar branch, first create the branch using svn. bzr-svn will create the branch and add the changes in a single commit, which confuses Subversion tools such as Combinator.

svn cp svn+ssh:// svn+ssh://

Then, re-base your local Bazaar branch onto the Subversion branch:

cd ~/Projects/Twisted/fix-bug-1234
bzr rebase svn+ssh://

Then push your Bazaar branch to the new Subversion branch using the 'dpush' plugin, to avoid polluting the Subversion repository with Bazaar metadata.

cd ~/Projects/Twisted/fix-bug-1234
bzr dpush svn+ssh://

Committing a Bazaar branch to trunk

Please use Subversion to land your branch. (We've had bad experiences with bazaar metadata in older revisions, so until someone has clearly demonstrated that all those issues have been addressed, we'd like to avoid it.)

Last modified 12 months ago Last modified on 03/17/2014 12:38:55 PM