/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/workingtree_4.py

  • Committer: Ian Clatworthy
  • Date: 2009-05-28 13:44:54 UTC
  • mto: (4385.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4390.
  • Revision ID: ian.clatworthy@canonical.com-20090528134454-p1kkcddnnq4gpm4k
back out tree-level cache of dirstate entries as agreed during review

Show diffs side-by-side

added added

removed removed

Lines of Context:
1564
1564
        self._repo_supports_tree_reference = getattr(
1565
1565
            repository._format, "supports_tree_reference",
1566
1566
            False)
1567
 
        # Simple cache of last dirstate lookup
1568
 
        self._last_entry_lookup = None
1569
 
        self._last_entry = None
1570
1567
 
1571
1568
    def __repr__(self):
1572
1569
        return "<%s of %s in %s>" % \
1639
1636
            raise errors.BzrError('must supply file_id or path')
1640
1637
        if path is not None:
1641
1638
            path = path.encode('utf8')
1642
 
        cache_key = file_id or ("path:%s" % path)
1643
 
        if self._last_entry_lookup != cache_key:
1644
 
            parent_index = self._get_parent_index()
1645
 
            self._last_entry = self._dirstate._get_entry(parent_index,
1646
 
                fileid_utf8=file_id, path_utf8=path)
1647
 
            self._last_entry_lookup = cache_key
1648
 
        return self._last_entry
 
1639
        parent_index = self._get_parent_index()
 
1640
        return self._dirstate._get_entry(parent_index, fileid_utf8=file_id, path_utf8=path)
1649
1641
 
1650
1642
    def _generate_inventory(self):
1651
1643
        """Create and set self.inventory from the dirstate object.