/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/hashcache.py

  • Committer: Kent Gibson
  • Date: 2007-03-07 14:49:00 UTC
  • mfrom: (2324 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2350.
  • Revision ID: warthog618@gmail.com-20070307144900-6bt7twg47zul3w0w
merged 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 ?
86
87
        self.hit_count = 0
87
88
        self.miss_count = 0
88
89
        self.stat_count = 0
131
132
    def get_sha1(self, path, stat_value=None):
132
133
        """Return the sha1 of a file.
133
134
        """
134
 
        abspath = pathjoin(self.root, path)
 
135
        if path.__class__ is str:
 
136
            abspath = pathjoin(self.root_utf8, path)
 
137
        else:
 
138
            abspath = pathjoin(self.root, path)
135
139
        self.stat_count += 1
136
140
        file_fp = self._fingerprint(abspath, stat_value)
137
141