Using Bazaar for PHPUnit Development

Last December, when I was in Australia and started to work on the Object_Freezer code, I "dived into" Bazaar (bzr) and learned the value of local commits as they allow me to work offline, e.g. when disconnected during travel.

Thanks to bzr-svn, I can now work offline for PHPUnit development as well.

Here is my setup:

Firstly, setup a local shared repository for storing your branches in and checkout the trunk:

sb@ubuntu ~ % bzr init-repo --rich-root-pack phpunit
Shared repository with trees (format: rich-root-pack)
Location:
  shared repository: phpunit
sb@ubuntu phpunit % bzr checkout svn+ssh://sb@svn.phpunit.de/var/svn/phpunit/phpunit/trunk

I still use Subversion natively to deal with the release branches:

sb@ubuntu phpunit % svn co svn+ssh://sb@svn.phpunit.de/var/svn/phpunit/phpunit/branches/release/3.4
sb@ubuntu phpunit % svn co svn+ssh://sb@svn.phpunit.de/var/svn/phpunit/phpunit/branches/release/3.3

The bzr info command shows that the local Bazaar branch is related to a remote Subversion branch:

sb@ubuntu phpunit % bzr info trunk
Repository checkout (format: rich-root-pack)
Location:
  repository checkout root: trunk
        checkout of branch: svn+ssh://sb@svn.phpunit.de/var/svn/phpunit/phpunit/trunk
         shared repository: .

Next, create a feature branch and hack away:

sb@ubuntu phpunit % bzr branch trunk feature
Branched 205 revision(s).
(hack, hack, hack)
sb@ubuntu feature % bzr commit -m "blah blah blah"
(hack, hack, hack)
sb@ubuntu feature % bzr commit -m "blah blah blah"
sb@ubuntu trunk % bzr update
sb@ubuntu trunk % bzr merge ../feature
sb@ubuntu trunk % bzr commit -m "Message for SVN commit."

At least for the foreseeable future, I will not migrate the central Subversion repository of the PHPUnit project to Bazaar as Subversion is a good choice for implementing a centralized workflow and is well understood by those of my users that use PHPUnit from a Subversion checkout, for instance using svn:externals to integrate it with their own software configuration management.