Loggerhead question

Russel Winder russel.winder at concertant.com
Fri Oct 23 14:29:44 BST 2009


Matt,

On Fri, 2009-10-23 at 12:59 +0000, Matt Nordhoff wrote:
> Russel Winder wrote:
> > Is there a way of setting up Loggerhead with Apache that allows the same
> > URL to be used for browsing using a browser and branching using bzr or
> > Bazaar Explorer.
> > 
> > I have Loggerhead working fine on xxxx:8080/Bazaar/Project and pointing
> > Epiphany at it does everything required.  However doing "bzr info
> > xxxx:8080/Bazaar/Project" gives the "not a branch" error.
> > 
> > Thanks.
> 
> You can configure Apache to handle requests with "/.bzr/" in them itself
> instead of passing them to Loggerhead.

I am not sure that is going to help -- unless I am missing something
about Apache/Bazaar/Loggerhead (which is easily possible).

The problem at hand is when the URL http://xxxx/Bazaar/Flob is used from
a bzr command, e.g. bzr info, bzr branch, then it works as it does now,
but when the same URL is used from a browser then all the requests are
forwarded to Loggerhead.  This means the switching has to be on the
accessor not on the URL.

The problem being solved here is that currently when people look at
http://xxxx/Bazaar/Flob with a browser there are no entries because the
branches have no working trees and the .bzr directory doesn't show.  The
idea is to get Loggerhead to do the needful but without disturbing the
current branch access.

> Or, Loggerhead supports serving branches over HTTP, over both the dumb
> and smart servers. Maybe your Loggerhead is too old for that?

I guess this is going to be the easy way of doing things -- always
forward the URL to Loggerhead and let it deal with the bzr commands as
well as browser access.

I am using Ubuntu 9.04 Jaunty Jackalope so this is Loggerhead 1.10.  It
has been a shame that 1.17 as is in Karmic hasn't been backported to
Jaunty. 

> Be aware that, up until very recent revisions of bzr.dev and
> Loggerhead's trunk, there were problems serving branches in shared repos
> over the smart server. (Though you'd get a different error message than
> "not a branch". Something about a "jailbreak" if you're hitting the bzr
> bug, or IIRC "no repository present" if you're hitting the Loggerhead bug.)

The server is using Loggerhead 1.10 and Bazaar 2.0.0 by default.  So I
guess this is an issue.

> If you can't upgrade to fixed versions, you can work around the bugs by
> using "nosmart+http" URLs to make bzr only use the dumb server.
> 
> If you can upgrade Loggerhead but can't upgrade bzr, you can put this
> monkeypatch in loggerhead/apps/transport.py, courtesy of Andrew Bennetts:
> 
> # Monkey-patch to work around bug 348308
> from bzrlib.smart import request
> def _setup_jail(self):
>     if not self._backing_transport.base.startswith('chroot-'):
>         raise AssertionError('bad monkey! no banana!')
>     request.jail_info.transports = [self._backing_transport.clone('/')]
> request.SmartServerRequest.setup_jail = _setup_jail
> 
> Anyway, none of this matters if you don't use shared repos, but pretty
> much everybody does, so...

Actually the branches being served aren't shared repositories, they are
branches intended to be read only from the Web.

> (See bug #348308 [1] for details on the bug in bzr. I don't think anyone
> filed a bug for the Loggerhead issue.)
> 
> [1] <https://bugs.edge.launchpad.net/bzr/+bug/348308>
-- 
Russel.
=============================================================================
Dr Russel Winder      Partner
                                            xmpp: russel at russel.org.uk
Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,   f: +44 8700 516 084   voip: sip:russel.winder at ekiga.net
London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20091023/67915396/attachment-0001.pgp 


More information about the bazaar mailing list