[MERGE][0.16?] Normalise URLs in RemoteHTTPTransport

Andrew Bennetts andrew at canonical.com
Fri Apr 27 03:29:41 BST 2007


RemoteHTTPTransport tries to POST to the same .bzr/smart location where possible
(i.e. when accessing a child of the transport's base).  Unfortunately it could
get confused by the escaping of e.g. ~ in URLs.  This meant that accessing:

  * bzr+http://host/~user/path would attempt to POST to
    ../../%7Euser/path/.bzr/smart, and
  * bzr+http://host/%7Euser/path would POST to the right .bzr/smart, with a
    request of "get ../../~user/path".

Both of these are broken, and prevents bzr 0.16rc1 from being able to open
branches on bzr+http://bazaar.launchpad.net/ (although earlier bzr versions
can't either, because RemoteHTTPTransport didn't have the logic to POST to a
consistent .bzr/smart location).

This bundle fixes that.

I'm inclined to think that we should be normalising URLs more consistently,
perhaps always normalising URLs given to urlutils.relative_url and so on.  This
bundle just does the most conservative change (i.e. just changes
RemoteHTTPTransport) in the hope that it can be applied to the 0.16 branch.

URLs without special characters that need encoding are not affected by this bug.

-Andrew.




More information about the bazaar mailing list