At PyCon, I helped several Twisted developers to use Bazaar to work on Twisted, even though the repository is still SVN. Here's how to do it.
First, install bzr and the bzr-svn plugin. I strongly recommend using the latest release of bzr-svn, 0.4.9, as Jelmer is fixing bugs and improving the speed at an impressive rate. 0.4.9 is in Ubuntu Hardy.
Then make a shared repository for your Twisted branches:
bzr init-repo --rich-root-pack Twisted
--rich-root-pack is a common gotcha: the default
repository format in bzr 1.3 doesn't have a feature bzr-svn needs.)
Then checkout the SVN trunk into the repository. You could do this direct from SVN, but it's much faster to use an already converted copy:
cd Twisted bzr checkout http://www.twistedmatrix.com/users/spiv/bzr/twisted/trunk/ cd trunk bzr switch svn://svn.twistedmatrix.com/svn/Twisted/trunk
To work on a branch already in SVN, you can just checkout or branch (depending on which workflow you prefer) it directly into your local repository. Checkouts will be more familiar to SVN users than independent branches, but if you want to make commits you'll need write access to Twisted's SVN repository.
cd .. bzr checkout svn://svn.twistedmatrix.com/svn/Twisted/branches/feature-branch-1 cd feature-branch-1 hack hack hack... bzr commit
(Don't worry too much about branches vs. checkouts. You can always use
bzr reconfigure to change a checkout into a branch and vice versa
if you change your mind later.)
To make a new branch in the SVN repository it's best to just use svn cp as before, then make a checkout/branch of that with bzr. (See bug 203368)
svn cp svn://svn.twistedmatrix.com/svn/Twisted/trunk svn://svn.twistedmatrix.com/svn/Twisted/branches/new-branch bzr checkout svn://svn.twistedmatrix.com/svn/Twisted/branches/new-branch
If you can't commit to Twisted SVN you can still use bzr. Just make
independent branches rather than checkouts. To share your branches with
other people you can simply
bzr push them to anywhere you
like, including Launchpad.
And that's really it. Everything else is just regular bzr, including the excellent merging and offline commits.
For example, here's how you'd merge a branch to trunk and commit it:
bzr checkout svn+ssh://svn.twistedmatrix.com/svn/Twisted/trunk cd trunk bzr merge ../my-branch # or you could use an SVN url! bzr commit
Last modified: 06 April 2008
Powered by backwards