~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-05 16:03:11 UTC
  • mfrom: (6432 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6433.
  • Revision ID: jelmer@samba.org-20120105160311-12o5p67kin1v3zps
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

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