bzr howto for the MatPLC project

This document is a quick tutorial for using bzr (Bazaar-NG) in the MatPLC project.

Setting up

First of all, you have to tell bzr your name and e-mail address. This will be used on log messages and code histories to identify your contributions.

bzr whoami 'Your Name <>'

You only need to do this once - bzr will remember it.

Getting the code

bzr branch mat-coruscant
bzr branch mat-coruscant mat-devel
cd mat-devel
bzr pull --remember URL

where URL is another developer's branch. This will: (1) get coruscant, (2) make a devel branch for you and (4) update the devel branch to the given URL.

Please use this procedure rather than directly branching off a developer's branch. For one thing, it'll be a lot faster, because SourceForge has a bigger pipe.

Where to bzr pull from

Depending on your interest, you might use the devel version from the following places:

Keeping up to date

There are two different commands; which one you use depends on the situation.

bzr pull [OTHER]

bzr merge [OTHER]

A "pull" is simpler, but only works if you haven't made any changes (or if they've been already merged on the other end). This means that either it will work completely or not at all - you can never get a conflict from a simple "pull".

If you have made changes, you have to use "merge", fix up conflicts (if any) and then commit.

OTHER is the URL of another branch; if omitted, it defaults to the URL used with --remember or the original bzr branch. It can also be the filename of a "bundle" file (see "publishing your changes", below, for how to create such files).

Starting work on a new feature

bzr branch SRC DEST

Here, SRC and DEST will both be local directory names; often SRC will be your main branch and DEST will be the name of the feature you're working on. This gives you a new branch where you can work on the new feature. If others want to help you with that change, you can let them branch off the new branch.

Working on a branch

Just like cvs:

bzr status
bzr diff
bzr commit
bzr add
bzr remove
bzr mv

Merging a feature back into main

  1. Make sure the branch is up to date with the main line, using "bzr pull" and/or "bzr merge" on the branch.
  2. Go into your main branch and do a "bzr pull ../FEATURE"

Publishing your changes

There are two methods, one for occasional use and one for regular use.

Other questions

Please send them to me or to the mailing list.

Documentation for bzr

bzr Tutorial

Further bzr documentation