How I use Bazaar on Exaile

In the Exaile project, we use Bazaar as we used Subversion before (with one central repository that everyone commits to). This post explains the local repository setup and the daily workflow that works best for me and matches the overall project workflow. It may not be perfect for other people or other projects.

One of my biggest problems with Subversion is its lack of local commits (which is why I use SVK for Subversion projects that I contribute to, but I digress). Distributed revision control systems like Bazaar and SVK do not have this problem. I normally have two branches on my machine: one for my work area and one as the mainline/trunk copy (so I can compare my work with the mainline version easily). I make changes in the work branch, do as many commits, rollbacks, etc. as I need to, and when I’m finished I push all the changes to the main branch, and from there push it to the remote repository. This is basically the workflow promoted by SVK.

In SVK, the “main” branch would be a mirror of the remote repository; any commits there are immediately propagated to the remote repo. This means that the second push, from my local mirror to the remote repo, is unnecessary. I wanted something like that in Bazaar; pushing changes twice gets annoying after some time. Then it hit me that SVK’s mirror is basically very similar to Bazaar’s checkout (a.k.a. bound branch). I simply turned my main branch into a checkout (using bzr bind), and now it works perfectly the way I want it to.

This is the complete setup of my local repository:

$ bzr init-repo exaile
$ cd exaile
$ bzr co lp:exaile main
$ bzr branch main work

My daily workflow goes like this:

$ bzr up main
$ cd work
$ bzr pull ../main
$ vi
$ bzr ci -m "Fix bug 1000."
$ vi
$ bzr ci -m "Fix bug 1001."
$ bzr push ../main

If the remote repository has been modified since I updated it,

$ cd ../main
$ bzr up
$ bzr merge ../work
$ bzr ci -m "Merge."

Note: By commenting, you grant me permission to freely republish your comment.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.