Loggerhead: A web viewer for bzr branches

Loggerhead is a web viewer for projects in Bazaar. It can be used to navigate a branch history, annotate files, view patches, perform searches, etc. Loggerhead is heavily based on bazaar-webserve, which was, in turn, loosely based on hgweb.

Getting Started

Loggerhead depends on the following Python libraries.:

  • SimpleTAL for templating.
  • simplejson for producing JSON data.
  • Paste for the server. (You need version 1.2 or newer of Paste).
  • Paste Deploy (optional, needed when proxying through Apache).
  • flup (optional, needed to use FastCGI, SCGI or AJP).

Installing Dependencies Using Ubuntu Packages

$ sudo apt-get install python-simpletal
$ sudo apt-get install python-simplejson
$ sudo apt-get install python-paste
$ sudo apt-get install python-pastedeploy
$ sudo apt-get install python-flup

Installing Dependencies Using easy_install

$ easy_install \
  -f http://www.owlfish.com/software/simpleTAL/py2compatible/download.html \
  SimpleTAL
$ easy_install simplejson
$ easy_install Paste
$ easy_install PasteDeploy
$ easy_install flup

Running the Standalone Loggerhead Server

After installing all the dependencies, you should be able to run serve-branches with the branch you want to serve on the command line:

./serve-branches ~/path/to/branch

By default, the script listens on port 8080, so head to http://localhost:8080/ in your browser to see the branch.

You can also pass a directory that contains branches to the script, and it will serve a very simple directory listing at other pages.

You may update the Bazaar branches being viewed at any time. Loggerhead will notice and refresh, and Bazaar uses its own branch locking to prevent corruption.

See serve-branches for all command line options.

Running Loggerhead as a Daemon

To run Loggerhead as a linux daemon:

  1. Copy the loggerheadd scipt to /etc/init.d
$ sudo cp ./loggerheadd /etc/init.d
  1. Edit the file to configure where your Loggerhead is installed, and which serve-branches options you would like.
$ sudo vim /etc/init.d/loggerheadd
  1. Register the service
# on upstart based systems like Ubuntu run:
$ sudo update-rc.d loggerheadd defaults

# on Sysvinit based systems like Centos or SuSE run:
$ sudo chkconfig --add loggerheadd

Using Loggerhead as a Bazaar Plugin

This branch contains experimental support for using Loggerhead as a Bazaar plugin. To use it, place the top-level Loggerhead directory (the one containing COPYING.txt) at ~/.bazaar/plugins/loggerhead. E.g.:

$ bzr branch lp:loggerhead ~/.bazaar/plugins/loggerhead
$ cd ~/myproject
$ bzr serve --http

Using a Config File

To hide branches from being displayed, add to ~/.bazaar/locations.conf, under the branch’s section:

[/path/to/branch]
http_serve = False

More configuration options to come soon.

Serving Loggerhead behind Apache

If you want to view Bazaar branches from your existing Apache installation, you’ll need to configure Apache to proxy certain requests to Loggerhead. Adding lines like this to your Apache configuration is one way to do this:

<Location "/branches/">
    ProxyPass http://127.0.0.1:8080/branches/
    ProxyPassReverse http://127.0.0.1:8080/branches/
</Location>

If Paste Deploy is installed, the serve-branches script can be run behind a proxy at the root of a site, but if you’re running it at some path into the site, you’ll need to specify it using --prefix=/some_path.

Support

Discussion should take place on the bazaar-dev mailing list at mailto:bazaar@lists.canonical.com. You can join the list at <https://lists.ubuntu.com/mailman/listinfo/bazaar>. You don’t need to subscribe to post, but your first post will be held briefly for manual moderation.

Bugs, support questions and merge proposals are tracked on Launchpad, e.g:

Hacking

To run Loggerhead tests, you will need to install the package python-nose, and run its nosetests script in the Loggerhead directory:

nosetests

License

GNU GPLv2 or later.

Index