Bazaar for GNOME developers
** WORK IN PROGRESS **
For those who want to use Bazaar with GNOME, there is a machine (bzr-playground.gnome.org) where any GNOME contributor can publish Bazaar branches. Any hacker with GNOME subversion access should be able to access the machine using their usual SSH key. This machine runs a full mirror of GNOME svn into bzr. The log of the mirror process is available at http://bzr-playground.gnome.org/.mirror-log.
SSH Setup
If your GNOME user name differs from your local user name, you will need to edit ~/.ssh/config to add a stanza like:
Host bzr-playground.gnome.org User username
If your user name differs, you will need to set the GNOME_USER environment variable for some scripts to function correctly:
export GNOME_USER=username
You can check that this is all correct by executing bzr on the server:
$ ssh bzr-playground.gnome.org bzr rocks It sure does!
Install Bazaar
you will need to install Bzr on your machine. Instructions for installing it on various distributions can be found here. You will need at least Bazaar 1.0, but later versions are preferred. For best performance, install 1.6b2.
Before making any commits, you should tell Bazaar what user ID to use. Traditionally an email address is used for this:
$ bzr whoami "Fred Smith <fred@example.com>"
Grabbing a module
A helper script is available to help set up a Bazaar working environment locally. You can grab it with:
wget http://svn.gnome.org/svn/vcs-mirror/trunk/contrib/bzr-gnome-setup.py
You can then check out a branch with e.g.:
./bzr-gnome-setup.py module [branch-name]
If no branch name is provided, the name "devel" will be used. The script will do the following:
Create a repository at ~/gnome-bzr/repos/$module.
Create a branch under ~/gnome-bzr/repos/$module/$branch.
A working tree will be created under ~/gnome-bzr/src/$module for the new branch.
A matching repository will be created on bzr-playground.gnome.org for you to push your changes to.
Bazaar will be configured to push the branch to bzr-playground.gnome.org by default.
The files in ~/gnome-bzr/repos represent the local branch data, while the
So we can create a branch of Sound Juicer with:
$ ./bzr-gnome-setup.py sound-juicer $ cd ~/gnome-bzr/src/sound-juicer
You can then make your changes and commit them. The changes can be pushed to bzr-playground.gnome.org with the bzr push command. Your published branches can be browsed through the web at http://bzr-playground.gnome.org/~$user.
The bzr-gnome-setup.py script provides a suggested layout and workflow for using Bazaar, but others are possible. The tutorial and users guide are good places to start.
Working
Lets add a new i-am-luis filter to cheese. Lets branch trunk:
$ ./bzr-gnome-setup cheese auto-i-am-linux $ cd ~/gnome-bzr/src/cheese
And now it's a lot like the SVN you know and love:
# add a file vi i-am-luis.c bzr add i-am-luis.c
You can check on what you've done:
bzr stat bzr diff
Check it in to the branch
bzr ci -m "Commit message"
And then, when its done, push the branch so others can see:
bzr push
Merging
Some cool stuff landed in trunk, and we need it. Pull won't work, and tells you to merge. You can just do
cd ~/gnome-bzr/src/cheese bzr merge # review the changes, fix any conflicts bzr commit -m "[merge] from upstream"
You can merge again and again and Bazaar will "just work". How very GNOME of it, right? Unlike Subversion 1.4, which does no merge tracking, bzr-svn does track merges. So it knows what its merged in already. Yay.
Merging from Others
You can merge from other people who have published branches with the following command:
bzr merge bzr+ssh://bzr-istanbul.gnome.org/bzr/user/cheese/branchname # review the changes and fix conflicts bzr commit
Getting stuff upstream
Todo
Workflow for GNOMErs without svn accounts: http://blogs.gnome.org/jamesh/2007/07/31/bazaar-bundles/
- Dealing with conflicts and merging from other sources
