~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/__init__.py

  • Committer: Martin Pool
  • Date: 2006-03-10 06:09:25 UTC
  • mto: This revision was merged to the branch mainline in revision 1609.
  • Revision ID: mbp@sourcefrog.net-20060310060925-7b26b6236c7cd6e5
[patch] LocalTransport.list_dir should return url-quoted strings (ddaa)

When trying to convert a Launchpad branch into metadir format, I hit a
bug caused by incorrect url quoting in LocalTransport (one of weaves has
a '/' in its id).

The attached patch fix LocalTransport.list_dir to allow converting
Launchpad to metadir. It should probably be augmented by a number of
test cases, and probably overlaps wildly with John's local transport
quoting branch. But I'm posting it here for the record.

Show diffs side-by-side

added added

removed removed

Lines of Context:
602
602
    return urllib.quote(relpath)
603
603
 
604
604
 
 
605
def urlunescape(relpath):
 
606
    """Unescape relpath from url format."""
 
607
    import urllib
 
608
    return urllib.unquote(relpath)
 
609
    # TODO de-utf8 it last. relpath = utf8relpath.decode('utf8')
 
610
 
 
611
 
605
612
class Server(object):
606
613
    """A Transport Server.
607
614