December 6, 2008

As anyone who’s developed core patches knows, it’s not the writing of initial patch that takes the work, it’s the combination of revising the patch and keeping up to date with HEAD. With Drupal.org’s CVS, this is difficult because you cannot commit your core changes to checkpoint your work. CVS’s merge algorithms are also relatively poor for maintaining large divergence from CVS HEAD.

One option — which several community members used to create the huge DB-TNG patch — was to create a Subversion repository. This is far too much overhead for smaller core patches, and it still required person-by-person approval to commit to the Subversion repository.

Four Kitchens is now hosting a much more flexible system for users of Bazaar. Every hour, we synchronize core changes from CVS HEAD into our Drupal 7 branch, which is available for anonymous branching by anyone.

Simply download and install Bazaar, which has packages or installers for Linux, Windows, Mac OS X, and BSD. We’re using a repository format that should work with Bazaar 1.0 and newer, at a minimum.

Then, when you’re ready to develop, create a local branch and make its new directory your working directory.

Then, where you’re ready to develop, run this:
bzr branch bzr://vcs.fourkitchens.com/drupal/7 [optional-working-copy-directory]

You’ll have a fresh working copy with a number of benefits over a CVS checkout:

  • You can commit to your local branch to checkpoint your work: bzr commit
  • You can integrate in changes to HEAD using Bazaar’s superior merge algorithms:
    bzr merge
  • You can branch from your own branch: bzr branch [existing] [new]
  • If you’re working with others and they have Bazaar branches, too, you can merge from their branches to collaborate.

And when you’re ready to post a patch, run
bzr diff --old bzr://vcs.fourkitchens.com/drupal/7-all-history > mypatch.patch
to create a patch reflecting all of your changes relative to CVS HEAD.

And when you’re ready to post a patch, run bzr diff --old bzr://vcs.fourkitchens.com/drupal/7 to create a patch reflecting all of your changes relative to CVS HEAD.

It will be a while before Drupal.org moves to anything other than CVS. Until then, we can foster decentralized development quite effectively using something like the Four Kitchens repository.

Note (2009-12-07): Yes, I realize Launchpad has a similar service that stores more detailed revision data, but I often find Launchpad slow or unresponsive. We also maintain Bazaar branches of stable Drupal 5 and 6; just replace the “7” above with “5” or “6”.

Note (2009-02-09): I have updated this post to use the new Bazaar branch for Drupal HEAD. We also maintain Bazaar branches of stable Drupal 5 and 6; just replace the “7-all-history” above with “5” or “6”. All obsolete information is now crossed out and replaced. I’ve maintained the obsolete instructions in case anyone is actively using them; they will continue to function.

Posted in

Comments