'bzr update' fails in an http Launchpad checkout

John Arbash Meinel john at arbash-meinel.com
Mon Oct 29 20:31:16 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I just ran into this bug which has been mentioned in the past. I couldn't find
a bug number for it, but I went ahead and debugged it.

Basically, what is happening is that URL escaping is messing up our strings,
and then the comparison fails.

Specifically in Branch.pull() we have:

def pull(self, source ...):

  bound_location = self.get_bound_location()
  master_branch = None
  if bound_location and source.base != bound_location:
    master_branch = self.get_master_branch(...)
    master_branch.lock_write()
...

What happened is that 'self.get_bound_location()' was returning:
  http://bazaar.launchpad.net/~bzr/bzr-gtk/trunk/

But "source.base" was giving:
  http://bazaar.launchpad.net/%7Ebzr/bzr-gtk/trunk/

This is caused at the Transport layer. At least, doing

>>> trans = transport.get_transport(
...       u'http://bazaar.launchpad.net/~bzr/bzr-gtk/trunk/')
>>> trans.base
'http://bazaar.launchpad.net/%7Ebzr/bzr-gtk/trunk/'


I was able to track it down into the ConnectedTransport.__init__ which is
splitting and then unsplitting the URL. And _unsplit_url is doing:
        path = urllib.quote(path)


So ultimately... Do we just need a "urlutils.is_same_location()" which can
handle the escaping issues?
I certainly prefer to display the unescaped URLs, since they are nicer for a
human (~bzr makes sense, %7Ebzr doesn't mean much, and doesn't jump out
different from %7Fbzr, though the two are *very* different %7F is DELETE, IIRC).


John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHJkMUJdeBCYSNAAMRAjoiAJ9JupGds2IjX3VZQ9ieBTwfVzLw0gCdGkYY
frlK74fAB5mlesdABLmDfcE=
=oLKT
-----END PGP SIGNATURE-----



More information about the bazaar mailing list