url mangling interacting badly with http sites with trailing /

Bug #340830 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Triaged
Medium
Unassigned

Bug Description

urlutils.split("http://host/foo/") -> ("http://host/", "foo") rather
than ("http://host/", "foo/")

Also Transport._combine_paths strips trailing '/' in relpath. While
opening a 'foo/' it turns it into 'foo'.

This breaks e.g. 'bzr patch http://pastebin.ubuntu.com/129561/plain/'

The following (wrong because we can just remove the != '' check higher,
but easy for testing) - helps, it at least allows
get_transport(httpurlbase).get('something/') to work.
=== modified file 'bzrlib/transport/__init__.py'
--- bzrlib/transport/__init__.py 2009-02-23 15:42:47 +0000
+++ bzrlib/transport/__init__.py 2009-03-10 23:46:00 +0000
@@ -479,6 +479,8 @@
         path = '/'.join(base_parts)
         if not path.startswith('/'):
             path = '/' + path
+ if relpath.endswith('/'):
+ path += '/'
         return path

     def recommended_page_size(self):

This regularly bites users, so -

 affects bzr
 importance high

Tags: url
Martin Pool (mbp)
Changed in bzr:
assignee: nobody → Robert Collins (lifeless)
status: New → Confirmed
Revision history for this message
Mary Gardiner (puzzlement) wrote :

I'm assuming this is another example of the same problem:

$ bzr pull http://intertwingly.net/code/venus/
http://intertwingly.net/code/venus is permanently redirected to http://intertwingly.net/code/venus/
No revisions to pull.

Revision history for this message
John A Meinel (jameinel) wrote :

So the latter is because of the "get_mergeable_from_url" which is trying to read a Merge Directive from the url that you supply.

Arguably we could try to read it from "venus/" rather than "venus"...

Revision history for this message
Robert Collins (lifeless) wrote :

While this does still need to be done, it really isn't as important as most of our highs, and I'm not actively working on it.

Changed in bzr:
assignee: Robert Collins (lifeless) → nobody
importance: High → Medium
Jelmer Vernooij (jelmer)
tags: added: url
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → Medium
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.