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

  • Committer: John Arbash Meinel
  • Date: 2006-05-27 02:54:05 UTC
  • mto: (1711.2.26 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1734.
  • Revision ID: john@arbash-meinel.com-20060527025405-bdc9f0cd95bfef08
use iter_entries instead of lots of id2path calls

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib.inventory import Inventory
27
27
from bzrlib.osutils import fingerprint_file
28
28
 
 
29
 
29
30
class Tree(object):
30
31
    """Abstract file tree.
31
32
 
171
172
    def has_filename(self, filename):
172
173
        return bool(self.inventory.path2id(filename))
173
174
 
 
175
    def has_file_or_id(self, filename, file_id):
 
176
        """Do we have this filename or file_id?
 
177
 
 
178
        Some trees are faster to lookup by filename, some
 
179
        are faster by id, if we have both, figure out which
 
180
        one is better.
 
181
        """
 
182
        # Default to has_id, since that is best for Revision trees
 
183
        return self.has_id(file_id)
 
184
 
174
185
    def list_files(self):
175
186
        # The only files returned by this are those from the version
176
187
        for path, entry in self.inventory.iter_entries():