serve-branches doesn't work with file-system paths, causes error 404s

Bug #1215941 reported by edam
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
loggerhead
New
Undecided
Unassigned

Bug Description

Running serve-branches with a filesystem path (and not using --allow-writes), like this:

  $ ./serve-branches ~/bzr

will cause loggerhead not to be able to access the specified path and it will always respond with error 404 over http.

This is because:

1. in loggerhead/main.py, when --allow-writes is not present, "readonly+" is pre-pended to the path to the bzr repos.

    E.g., "/home/edam/bzr" becomes "readonly+/home/edam/bzr"

2. in loggerhead/apps/transport.py, get_transport_for_thread(), which calls bzrlib's get_transport(), is called on the path. When the path has not specified protocol, this treats the "readonly+" as part of the path.

    E.g., "readonly+/home/edam/bzr" becomes "file:///home/edam/www/ed.am/bzr/readonly%2B/home/edam/bzr/"

The result is obviously wrong.

The solution to this seems to be to always specify a full path *and protocol* to the bzr repos. So, in the above example, the server can successfully be run like this:

  $ ./serve-branches file:///home/edam/bzr

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.