3
I can confirm the attached bug report, that `bzr branches` does not seem
4
to work with http:// URLs. I digged a bit in the source, and as far as I
5
can see the problem is that the t.get('.') line in apache_ls() raises a
6
RedirectRequested exception, which is silently swallowed in iter_bzrdirs().
8
I don't know much about bzr transport, but I tried to fix the issue with
9
do_catching_redirections, but it didn't seem to work, see the attached
10
script. What happens is that the trailing slash gets lost somewhere:
12
get_transport('http://bzr.debian.org/bzr/pkg-maemo').get('.')
14
raises a RedirectRequested exception whose .target is
15
http://bzr.debian.org/bzr/pkg-maemo/ (one trailing slash added); BUT:
17
get_transport('http://bzr.debian.org/bzr/pkg-maemo/').get('.')
19
raises again the very same exception!! (same .source and .target); AND:
21
get_transport('http://bzr.debian.org/bzr/pkg-maemo//').get('.')
25
So two issues here, as I understand it:
27
1. `bzr branch` is not robust against redirections
28
2. transport code seems to be silently ignoring one trailing slash in URLs
30
Please let me know if I can be of any help.
33
------------------------8<---------------------------
37
from bzrlib.errors import RedirectRequested, TooManyRedirections
38
from bzrlib.transport import get_transport, do_catching_redirections
40
url = sys.argv[1:] and sys.argv[1] or 'http://bzr.debian.org/bzr/pkg-maemo'
41
transport = get_transport(url)
45
except RedirectRequested:
46
print "A RedirectRequested was raised, trying now with do_catching_redirections."
48
print "No RedirectRequested was raised, URL not good for this test."
52
lines = do_catching_redirections(lambda t: t.get('.'), transport,
53
lambda t, e, notice: get_transport(e.target))
54
except TooManyRedirections:
55
print "We got TooManyRedirections, that's bad."
57
print "do_catching_redirections works nicely."
58
------------------------>8---------------------------
61
----- Forwarded message from Loïc Minier <lool@dooz.org> -----
63
From: Loïc Minier <lool@dooz.org>
64
To: Debian Bug Tracking System <submit@bugs.debian.org>
65
Date: Sun, 29 Jul 2007 12:12:10 +0200
66
Subject: Bug#435110: "bzr branches" doesn't work with http:// URLs
74
bzr branches works with:
75
bzr+ssh://bzr.debian.org/bzr/pkg-maemo
76
bzr+ssh://bzr.debian.org/bzr/pkg-maemo/hildon-desktop
77
sftp://bzr.debian.org/bzr/pkg-maemo
78
~/bzr/debian/pkg-maemo
80
http://bzr.debian.org/bzr/pkg-maemo
81
http://bzr.debian.org/bzr/pkg-maemo/hildon-desktop
82
while bzr ls works on:
83
http://bzr.debian.org/bzr/pkg-maemo/hildon-desktop/ubuntu
85
I see there's a special case for http:// in the code; could this be the
86
issue? Or is this because iterating over HTTP requires listing the