~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/hashcache.py

  • Committer: Alexander Belchenko
  • Date: 2007-01-04 23:36:44 UTC
  • mfrom: (2224 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2225.
  • Revision ID: bialix@ukr.net-20070104233644-7znkxoj9b0y7ev28
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
    def __init__(self, root, cache_file_name, mode=None):
84
84
        """Create a hash cache in base dir, and set the file mode to mode."""
85
85
        self.root = safe_unicode(root)
86
 
        self.root_utf8 = self.root.encode('utf8') # where is the filesystem encoding ?
87
86
        self.hit_count = 0
88
87
        self.miss_count = 0
89
88
        self.stat_count = 0
132
131
    def get_sha1(self, path, stat_value=None):
133
132
        """Return the sha1 of a file.
134
133
        """
135
 
        if path.__class__ is str:
136
 
            abspath = pathjoin(self.root_utf8, path)
137
 
        else:
138
 
            abspath = pathjoin(self.root, path)
 
134
        abspath = pathjoin(self.root, path)
139
135
        self.stat_count += 1
140
136
        file_fp = self._fingerprint(abspath, stat_value)
141
137