Some notes on Bazaar

This started off as a reply to some email on the Bazaar-NG list, but it sort of grew and grew, until there were a whole bunch of things in it, and I thought it would probably be better as a weblog entry, so that I could find it later.

On to the email...
Martin Pool wrote:
> If you have sftp access to your server, then just do
> bzr init-repo sftp://user@host/~/myproject
> bzr push sftp://user@host/~/myproject/mybranch
> then on the second machine (eg at work)
> bzr init-repo ~/myproject
> cd myproject
> bzr branch sftp://user@host/~/myproject/mybranch

As a related question, if I wanted other people to be able to download my branch over http, would it suffice to do something on the server like

bzr init-repo ~/www/myproject
cd ~/www/myproject
bzr branch sftp://user@host/~/myproject/mybranch

or would I need to push straight to ~/www/myproject/mybranch?

I'm of two minds here, and I'ld like to explain why, in case it's a common problem. On the one hand, the repo I created by following the steps in the first part of Martin's message
> bzr init-repo sftp://user@host/~/myproject
> bzr push sftp://user@host/~/myproject/mybranch
should be just the same as any other repository, right?

But, on the other hand, when I ssh to "user@host", and look in ~/myproject, all I see is a .bzr directory. None of the files I allegedly pushed.

A search for 'bzr push "no content"' and 'bzr push missing files' turns up nothing that makes much sense to me. running 'bzr help push' finally shows me the following lines:
> The target branch will not have its working tree populated because
> this is both expensive, and is not supported on remote file systems.
which explains it at least a little. So I started looking for a way to push and update, which quickly led me to the push-and-update plugin, but I'm now lost as to how to install it into my copy of bzr (the binary distribution, running under Windows XP.) The plugins document that ships with bzr says "typically found in /usr/lib/python2.4/site-packages/bzrlib/plugins/", but I'm really fairly sure that's not where it's located on my box... another page says that it is "usually [...] C:\python2.4\site-packages\bzrlib\plugins under Windows", but again, that directory doesn't exist where I am.

Since I expect it'll make a difference to any answer I get, let me just say upfront that I've installed Bazaar (bzr) 0.18.0 into C:\Program Files\Bazaar\ using the Windows standalone installer. The output of "bzr version" is:
Bazaar (bzr) 0.18.0
Using Python interpreter: C:\Program Files\Bazaar\bzr.exe
Using Python standard library: C:\Program Files\Bazaar\lib\
Using bzrlib: C:\Program Files\Bazaar\lib\\bzrlib
Using Bazaar configuration: C:/Documents and Settings/blake/Application Data/bazaar/2.0
Using Bazaar log file: C:\Documents and Settings\blake\My Documents\.bzr.log

Copyright 2005, 2006, 2007 Canonical Ltd.

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and you may use, modify and redistribute it under the terms of the GNU General Public License version 2 or later.

So, where should I put the plugins in this case?

The answer, as given on irc, seems to be "put it somewhere else and set the BZR_PLUGIN_PATH env variable". Works for me, although it would have been nice if the Windows standalone installer did that for me, by creating a Plugins directory under the install directory. And as one final note, the BZR_PLUGIN_PATH, which it may contain spaces (i.e. "C:\Program Files\Bazaar\Plugins"), must not end in a trailing "\".


Comments powered by Disqus