~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.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:
43
43
from bzrlib.symbol_versioning import *
44
44
from bzrlib.trace import mutter
45
45
from bzrlib.transactions import WriteTransaction
46
 
from bzrlib.transport import get_transport
 
46
from bzrlib.transport import get_transport, urlunescape
47
47
from bzrlib.transport.local import LocalTransport
48
48
from bzrlib.weave import Weave
49
49
from bzrlib.xml4 import serializer_v4
1541
1541
        for store_name in ["weaves", "revision-store"]:
1542
1542
            self.pb.note("adding prefixes to %s" % store_name) 
1543
1543
            store_transport = self.bzrdir.transport.clone(store_name)
1544
 
            for filename in store_transport.list_dir('.'):
 
1544
            for urlfilename in store_transport.list_dir('.'):
 
1545
                filename = urlunescape(urlfilename)
1545
1546
                if (filename.endswith(".weave") or
1546
1547
                    filename.endswith(".gz") or
1547
1548
                    filename.endswith(".sig")):