Installing Bazaar 1.16 on OS X [Updated]

Recently I decided to bite the bullet and move away from Xcode’s Snapshots to using a DVCS. After checking out Git, Mercurial, and Bazaar I finally settled on the latter, for now at least.

Bazaar is a great, it has excellent documentation on a very well designed website, it’s incredibly easy to use (one of its design goals) so you can focus on what’s important (coding), it has support for both distributed and centralized workflows, it supports pushing and pulling from SFTP servers that do not have bazaar installations, and it uses revision numbers (instead of hashes), and it does so in a very intelligent way.

Unfortunately the latest version doesn’t seem to come in a tidy OS X Installer package, nor is it available via MacPorts (yet), so here are some tips to install it from source.

If you’ve previously installed Bazaar using the package installer you’ll probably want to clear out some of the files it installed prior to installing the new version:

cd /Library/Python/2.5/site-packages
sudo rm -rf bzr*
sudo rm -rf Loom-1.4.0dev0-py2.5.egg-info
sudo rm -rf subvertpy*
sudo rm -rf Extmerge-r10-py2.5.egg-info
sudo rm -rf qbzr-0.9.9-py2.5.egg-info
# we'll install the latest versions of these in a bit
sudo rm -rf BzrTools-1.14.0-py2.5.egg-info
sudo rm -rf pycrypto-2.0.1-py2.5.egg-info
sudo rm -rf paramiko*

We do that to avoid conflicts and because we want to install these plugins ourselves, so that we can use the latest versions.

Installing Dependencies

As mentioned in the note above, and on the InstallationFaq, there are 3 things that come with the package installer that you should install: Paramiko and pyCrypto (for SFTP support), and BzrTools.

Because of the way we’re installing Bazaar, you should install BzrTools *after* installing Bazaar 1.16 (detailed below). Installing Paramiko and pyCrypto is simple though, as you only need to download Paramiko (its installer will grab pyCrypto for you):

  1. Grab the latest version of Paramiko, as of this writing it’s 1.7.2:
  2. Extract the contents of the archive and ‘cd’ into the directory
  3. To build and install run these commands:
    python build
    sudo python install

Optionally, the InstallationFaq suggests installing Pyrex to speed things up.

Installing Bazaar 1.16

Download the source for 1.16 (direct link). After you’ve extracted it run these commands from the source dir:

python build
sudo python install --home /usr/local
sudo mv /usr/local/lib/python/bzr* /Library/Python/2.5/site-packages/

Note: On Snow Leopard the default Python install is 2.6, not 2.5.

Installing Bazaar Plugins on OS X

This too isn’t very clear from the Bazaar Plugins page. To install a plugin follow these steps:

  1. Pick a plugin from the plugins page and grab its branch URL, for example the URL for Rebase is:
  2. In some directory run:
    bzr branch [branch-URL]
  3. That will download the plugin source. ‘cd’ into the directory, in the above example it’s “trunk”.
  4. Build and install the plugin using the same commands as you used to install the dependencies.

That should do it. One note is that a lot of the plugins are hosted on launchpad, in which case grabbing them is simple (using ‘bzr-search’ as an example):

bzr branch lp:bzr-search

Now you can enjoy the benefits of running the latest version. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *