~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-19 10:58:39 UTC
  • mfrom: (6383 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6386.
  • Revision ID: jelmer@canonical.com-20111219105839-uji05ck4rkm1mj4j
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
from bzrlib.lazy_import import lazy_import
28
28
lazy_import(globals(), """
29
 
import urllib
30
 
 
31
29
from bzrlib import (
32
30
    annotate,
33
31
    bencode,
40
38
    multiparent,
41
39
    tsort,
42
40
    revision,
 
41
    urlutils,
43
42
    )
44
43
""")
45
44
from bzrlib.registry import Registry
823
822
 
824
823
    def map(self, key):
825
824
        """See KeyMapper.map()."""
826
 
        return urllib.quote(self._map(key))
 
825
        return urlutils.quote(self._map(key))
827
826
 
828
827
    def unmap(self, partition_id):
829
828
        """See KeyMapper.unmap()."""
830
 
        return self._unmap(urllib.unquote(partition_id))
 
829
        return self._unmap(urlutils.unquote(partition_id))
831
830
 
832
831
 
833
832
class PrefixMapper(URLEscapeMapper):
880
879
    def _escape(self, prefix):
881
880
        """Turn a key element into a filesystem safe string.
882
881
 
883
 
        This is similar to a plain urllib.quote, except
 
882
        This is similar to a plain urlutils.quote, except
884
883
        it uses specific safe characters, so that it doesn't
885
884
        have to translate a lot of valid file ids.
886
885
        """
893
892
 
894
893
    def _unescape(self, basename):
895
894
        """Escaped names are easily unescaped by urlutils."""
896
 
        return urllib.unquote(basename)
 
895
        return urlutils.unquote(basename)
897
896
 
898
897
 
899
898
def make_versioned_files_factory(versioned_file_factory, mapper):