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


2 hyrcan says...

Is there any logic behind the naming of the folders? Or is "group" and "project" place holders for what ever organisation convention we wish to use? For example: ~/repository/webgroup/awesomewebsite.com/trunk VS ~/repository/webgroup/funkywebsite.com/trunk

Or even ~/repository/finance/awesomewebsite.com/trunk (which could be where finance keeps track of the finance openoffice documents about the website project awesomewebsite.com)

Posted at 9:51 p.m. on December 22, 2008


3 Zeth says...

Hi hyrcan, you can name the folders however you like, but we are using it as ~/repository/webgroup/awesomewebsite.com/trunk VS ~/repository/webgroup/funkywebsite.com/trunk

Posted at 11:23 p.m. on December 22, 2008


4 Moritz says...

your link to http://commandline.org.uk/python/my-merry-five-minutes-with-bazaar-2007-06-04-23-35.html?showcomments=yes only throws an error...

Posted at 4:39 a.m. on January 15, 2009


5 Anish says...

hey Moritz,

Check this

http://commandline.org.uk/python/my-merry-five-minutes-with-bazaar/

Posted at 12:03 p.m. on June 25, 2009


6 mejor sitio de casinosq says...

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.

Posted at 7:31 a.m. on August 8, 2009


What do you have to say?

Show Editing Help

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

Essex Web Design

September 3, 2010
A lot of contract providers give you free internet usage now, but if you have Pay As You Go, then you are going to be paying heavy prices.
Calling time on mobile internet nonsense?

Krasochka

September 2, 2010
Hack again?!
Adding more terminals to your function keys

GenryFlorist

September 2, 2010
<b>Cheap flowers delivery around the world!</b> Celebrate summer with our gorgeous flowers. They?re the perfect gift for any summer occasion. From birthdays to anniversaries, we offer beautiful flowers, lush plants, ...
Burning an iso to CD on Windows

auto-financing.co.cc

September 2, 2010
auto-financing
ReStructuredText tables and doctests

rubaxa

September 1, 2010
FTP = NOT RANDOM software Dominated hands postflop suckout often on all-ins. EX. AK vs. A9 or KQ vs. K6. Both players hit top pair. Bad player goes all in ...
Burning an iso to CD on Windows

empodayaddelm

September 1, 2010
Sorry admin - my post is test
This Week: Heroes and Monsters

increase synthroid dosage

September 1, 2010
Latest world news: 1 <a target="_blank" class="ext" href=http://www.maktabti.org/profiles/blogs/viagra-cialis-buy-no>buy cheap cialis generic levitra viagra</a> Viagra 2 <a target="_blank" class="ext" href=http://www.maktabti.org/profiles/blogs/buy-viagra-online-at-lowest>rainbowpush discussion board buy viagra</a> Viagra 3 <a target="_blank" class="ext" href=http://www.maktabti.org/profiles/blogs/how-to-get-generic-brand>search viagra ...
SFTP in Python: Paramiko

Lacilslaw

September 1, 2010
HYUN JAIMIE enniless and homele JAMILA
This Week: Heroes and Monsters

domaserisk

August 31, 2010
who was shaking his head back and forth knowingly Grissom shifted his eyes over at Brass,
How I Removed Windows from my Laptop

get ready loan

August 30, 2010
Though, by the you kill the legitimate PC user from visiting the site. Also, think about the dynamic IP's issue.
Only the penitent man will pass - on captchas and cotton wool

Packers and movers in pune

August 30, 2010
The topic you disscussed here is very amazing, informative and useful in future...
On Comment Spam

serhanters1

August 30, 2010
?? ???????? ??... ??????...... ??. ????????? ??? ??? ???????D ???????? ??. ????? ????? ???? ??? ???=) ?? ?????- http://letitbit.net/download/8746.894a84bc20f38f1661895aeee0/stereokartinki.html ???http://f-zona.ru ? ? ?? ????????????
Burning an iso to CD on Windows

strona startowa

August 29, 2010
Thanks For This Post, was added to my bookmarks.
Python CGI contact forms

lerexottori

August 29, 2010
?????????????? ??????????
Adding more terminals to your function keys

KelpAugmeme

August 29, 2010
aofaapsymp, http://forums.quark.com/members/jennaq.aspx online stock trading broker, rdgofzary
PuTTY Series: Adding PuTTY to your system path

Cheeday

August 28, 2010
What flowers do you like?
This Week: Heroes and Monsters

magfcvb

August 28, 2010
??????? ?????????????? ?????? - ????? ?????? ?????????????? ??????, ?????????????? ?????? ???????, ?????????????? ?????? crosman, ???? ??????????????? ??????, ?????????????? ?????? ?????? ????????. ???? magazin-oruzhie.ru
Include ODF support in the Linux Standard Base?

noni

August 28, 2010
I find myself coming to your blog more and more often to the point where my visits are almost daily now!
On Comment Spam

Latenadsfes

August 28, 2010
http://mynewblog.for-breastcancer.com/ http://mynewblog.photoblogcentral.com/ http://ilovezebras.thechicks.org/ http://mynewblog.cyberbardsymposium.com/ http://wewphost.com/ilovezebras/
Burning an iso to CD on Windows

LeupoldEst

August 28, 2010
pretty cool stuff here thank you!!!!!!!
OOXML Vote Coverage