~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/weaverepo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-11-21 03:35:57 UTC
  • mfrom: (3834.2.2 controlfiles)
  • Revision ID: pqm@pqm.ubuntu.com-20081121033557-q9noqdq5v3ulpg9a
(mbp) Deprecate LockableFiles._escape

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    lockdir,
39
39
    osutils,
40
40
    revision as _mod_revision,
 
41
    urlutils,
41
42
    versionedfile,
42
43
    weave,
43
44
    weavefile,
67
68
    def _serializer(self):
68
69
        return xml5.serializer_v5
69
70
 
 
71
    def _escape(self, file_or_path):
 
72
        if not isinstance(file_or_path, basestring):
 
73
            file_or_path = '/'.join(file_or_path)
 
74
        if file_or_path == '':
 
75
            return u''
 
76
        return urlutils.escape(osutils.safe_unicode(file_or_path))
 
77
 
70
78
    def __init__(self, _format, a_bzrdir):
71
79
        # we reuse one control files instance.
72
80
        dir_mode = a_bzrdir._get_dir_mode()
77
85
            # or entirely uncompressed is tidy, but breaks upgrade from 
78
86
            # some existing branches where there's a mixture; we probably 
79
87
            # still want the option to look for both.
80
 
            relpath = a_bzrdir._control_files._escape(name)
 
88
            relpath = self._escape(name)
81
89
            store = TextStore(a_bzrdir.transport.clone(relpath),
82
90
                              prefixed=prefixed, compressed=compressed,
83
91
                              dir_mode=dir_mode,