~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

[merge] Storage filename escaping

Show diffs side-by-side

added added

removed removed

Lines of Context:
1536
1536
        return BzrDir.open(self.bzrdir.root_transport.base)
1537
1537
 
1538
1538
    def _convert_to_prefixed(self):
1539
 
        from bzrlib.store import hash_prefix
 
1539
        from bzrlib.store import TransportStore
1540
1540
        self.bzrdir.transport.delete('branch-format')
1541
1541
        for store_name in ["weaves", "revision-store"]:
1542
 
            self.pb.note("adding prefixes to %s" % store_name) 
 
1542
            self.pb.note("adding prefixes to %s" % store_name)
1543
1543
            store_transport = self.bzrdir.transport.clone(store_name)
 
1544
            store = TransportStore(store_transport, prefixed=True)
1544
1545
            for filename in store_transport.list_dir('.'):
1545
1546
                if (filename.endswith(".weave") or
1546
1547
                    filename.endswith(".gz") or
1548
1549
                    file_id = os.path.splitext(filename)[0]
1549
1550
                else:
1550
1551
                    file_id = filename
1551
 
                prefix_dir = hash_prefix(file_id)
 
1552
                prefix_dir = store.hash_prefix(file_id)
1552
1553
                # FIXME keep track of the dirs made RBC 20060121
1553
1554
                try:
1554
1555
                    store_transport.move(filename, prefix_dir + '/' + filename)