~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-24 07:28:00 UTC
  • mfrom: (2929.1.2 workingtree)
  • Revision ID: pqm@pqm.ubuntu.com-20071024072800-p2qtv2632xrbrs02
(robertc) Use a dictionary to obtain stat caches rather than digging into the dirstate on every path. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1098
1098
        :param path: The path.
1099
1099
        :param stat_result: The stat result being looked up.
1100
1100
        """
1101
 
        state = self.current_dirstate()
1102
 
        # XXX: should we make the path be passed in as utf8 ?
1103
 
        entry = state._get_entry(0, path_utf8=cache_utf8.encode(path))
1104
 
        tree_details = entry[1][0]
1105
 
        packed_stat = dirstate.pack_stat(stat_result)
1106
 
        if tree_details[4] == packed_stat:
1107
 
            return tree_details[1]
1108
 
        else:
1109
 
            return None
 
1101
        return self.current_dirstate().sha1_from_stat(path, stat_result)
1110
1102
 
1111
1103
    @needs_read_lock
1112
1104
    def supports_tree_reference(self):