~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: Alexander Belchenko
  • Date: 2012-03-29 08:34:13 UTC
  • mto: (6015.44.14 2.4)
  • mto: This revision was merged to the branch mainline in revision 6513.
  • Revision ID: bialix@ukr.net-20120329083413-d4bqqdtfn2yrxp4f
change st_dev, st_ino, st_uid, st_gid from int members to properties.

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
 
 
21
19
from copy import copy
22
20
from cStringIO import StringIO
23
21
import os
26
24
 
27
25
from bzrlib.lazy_import import lazy_import
28
26
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,
42
41
    )
43
42
""")
44
43
from bzrlib.registry import Registry
822
821
 
823
822
    def map(self, key):
824
823
        """See KeyMapper.map()."""
825
 
        return urlutils.quote(self._map(key))
 
824
        return urllib.quote(self._map(key))
826
825
 
827
826
    def unmap(self, partition_id):
828
827
        """See KeyMapper.unmap()."""
829
 
        return self._unmap(urlutils.unquote(partition_id))
 
828
        return self._unmap(urllib.unquote(partition_id))
830
829
 
831
830
 
832
831
class PrefixMapper(URLEscapeMapper):
879
878
    def _escape(self, prefix):
880
879
        """Turn a key element into a filesystem safe string.
881
880
 
882
 
        This is similar to a plain urlutils.quote, except
 
881
        This is similar to a plain urllib.quote, except
883
882
        it uses specific safe characters, so that it doesn't
884
883
        have to translate a lot of valid file ids.
885
884
        """
892
891
 
893
892
    def _unescape(self, basename):
894
893
        """Escaped names are easily unescaped by urlutils."""
895
 
        return urlutils.unquote(basename)
 
894
        return urllib.unquote(basename)
896
895
 
897
896
 
898
897
def make_versioned_files_factory(versioned_file_factory, mapper):