• Zeth will be attending PyCon UK on the 12th to 14th September 2008.

Setting up a bazaar server

24 February 2008

So last year I wrote a little tutorial about using bazaar for my own personal projects. Please read that if you have no idea what I am talking about.

This weekend I started working on a project with a small group of friends. Therefore we decided to create a bzr server so we can all track the code that we are writing together.

We could use the free Launchpad service, but some among the group feel that we are not ready to publically share the fledgling project with the world yet.

I will try to remember what we did and tell you about it; however, I am by no means a bzr expert so feel free to point out improvements in the comments section below.

I am assuming that the bzr server will be running on some kind of Linux or BSD/Mac OS X; you will need to make some minor modifications on Windows. This has been tested on only Gentoo, Debian and Ubuntu Linux.

The first thing of course is that one needs to have bzr installed. Bzr is available from its homepage or via your friendly neighbourhood package manager. It is again important to note that if your package manager is offering you both 'bzr' and 'baz' or 'bazaar', it is the former (bzr) you want.

To clear up the confusion, I'll quickly explain this. In the beginning (2001) there was a revision control system called 'GNU Arch'. In 2004, a fork of Arch was called 'bazaar', or 'baz'. In 2005, this was rewritten from scratch as 'bazaar' or 'bzr'. It is this modern maintained version that we are interested in. So make sure that you get that.

To guard yourself from incompatibles with the clients, it is worth having a recent version of bzr, anything older than 1.0 is probably too old at this point and you should consider upgrading, as the clients may have newer incompatible versions.

So we started by checking the bzr version:

bzr --version

We then created a username bzruser, this user will be used to run the server:

sudo useradd -m bzruser

Then we created the file layout

sudo su bzruser

mkdir -p /home/bzruser/repository/group/project/trunk

We then made the trunk directory into a versioned branch:

cd /home/bzruser/repository/group/project/trunk

bzr init

We are finally ready to start up the bzr server.

bzr server --directory=/home/bzruser/repository

The default port is 4155, if you want to use another port, you can use the --port option.

Now go to another terminal on the same machine and run the following command:

bzr check bzr://localhost/group/project/trunk/

It will now tell you that there are zero revisions, zero files and so on. We can also check out this non-existent code.

bzr co bzr://localhost/group/project/trunk/

Obviously, you will need to add some files to your repository! There are also a couple of sys-admin steps required.

Firstly, you will need to use a public URL or IP Address rather than localhost. If there is a filewall such as iptables, then you need to be sure that it allows access to bzr's port.

Secondly, you will need to make the bzr server start up when the machine boots, otherwise your machine will reboot and there will be no access to your repository until some human comes and starts the bzr server.

Discuss this post - Leave a comment

1 Chris says...

Great write up. It is exactly what I was looking for. Thanks!

Posted at 2:01 p.m. on May 28, 2008


What do you have to say?

Show Editing Help


PyCon UK

About

Hello, my name is Zeth, I'll be your host here.

Command Line Warriors is about taking control of your own technology, it looks at our experiences of computing; especially using GNU/Linux, the Python programming language, the command-line and issues such as techno-ethics, best practices and whatever is cool now. If you take control of your technology then you are a Warrior too!

This site is your site too which means that you can contribute and get involved. You can leave comments using the facility provided. For me, the comments and discussions are by far the best part of the site. So please do have your say!

Latest Discussions

Daniel Black

September 3, 2008
Hey, sounds good already. There's another Python script for command-line 140-character-messaging (won't call it "tweeting" for obvious reasons), Tweety Py, that's currently languishing. Not, I think, because the developer's disinterested, ...
Using new social networking service Identi.ca from the command line

Antonio Araujo

September 2, 2008
Dear friends, has anyone built debian packages of db xml 2.4.13? Best regards Antonio
Native XML storage with Berkeley DB XML - part one

Zeth

September 1, 2008
Thanks everyone for your different solutions, absolutely fantastic. I have tried them all. The one from Ciaran McCreesh was the one I was subconsciously groping for.
Sisu and typing unicode in GNOME

andylockran

September 1, 2008
In ubuntu, I do ctrl, and the functions to the right of my keyboard for extra characters. Such as: alt gr + ; + e for é I'll post more ...
Sisu and typing unicode in GNOME

Jinks

September 1, 2008
I am from Germany but i use an US-layout keyboard since that's a lot easier for most my programming needs. Now, having to also write the occassional german letter or ...
Sisu and typing unicode in GNOME

Toni

September 1, 2008
Hi, You might want to add an xkb keymap. Make backups before you begin ;) And sorry about formatting. in /usr/share/X11/xkb/symbols/gb, after "intl", add this: partial alphanumeric_keys xkb_symbols "intl_fi" { ...
Sisu and typing unicode in GNOME

Ciaran McCreesh

September 1, 2008
On a UK keyboard you do alt-gr+[ followed by a to get ä. You don't need the control key at all.
Sisu and typing unicode in GNOME

name

September 1, 2008
Hi!,
List files recursively by modified time

name

September 1, 2008
Hello!,
List files recursively by modified time

Leif

September 1, 2008
On my Norwegian keyboard, the diaeresis is easily accessible, like on Jani's Finnish one. It's one of the few keys that doesn't advance the cursor, along with the tilde, circumflex ...
Sisu and typing unicode in GNOME

Lornix

September 1, 2008
ä <= compose, ", a ö <= compose, ", o å <= compose, o, a Ä <= compose, ", A Ö <= compose, ", O Å <= compose, o, A ...
Sisu and typing unicode in GNOME

name

September 1, 2008
Good day!,
List files recursively by modified time

Jani

September 1, 2008
Looks like typing letters with the umlaut (diaeresis) has been made particularly easy for those of us using a keyboard with Finnish keys and layout: compose isn't needed at all, ...
Sisu and typing unicode in GNOME