~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Patch Queue Manager
  • Date: 2012-01-27 14:28:32 UTC
  • mfrom: (6445.2.6 avoid-inventory)
  • Revision ID: pqm@pqm.ubuntu.com-20120127142832-qcv2y1c3i0mbt9bl
(jelmer) Avoid the use of inventories in a few more places. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
777
777
    @needs_read_lock
778
778
    def path2id(self, path):
779
779
        """Return the id for path in this tree."""
780
 
        return self._inventory.path2id(path)
 
780
        return self.inventory.path2id(path)
781
781
 
782
782
    def id2path(self, file_id):
783
783
        """Return the path for a file id.
793
793
        return self.inventory.has_id(file_id)
794
794
 
795
795
    def all_file_ids(self):
796
 
        return set(self.inventory)
 
796
        return set(
 
797
            [entry.file_id for path, entry in self.iter_entries_by_dir()])
797
798
 
798
799
    @deprecated_method(deprecated_in((2, 4, 0)))
799
800
    def __iter__(self):
800
 
        return iter(self.inventory)
 
801
        return iter(self.all_file_ids())
801
802
 
802
803
    def filter_unversioned_files(self, paths):
803
804
        """Filter out paths that are versioned.
807
808
        # NB: we specifically *don't* call self.has_filename, because for
808
809
        # WorkingTrees that can indicate files that exist on disk but that
809
810
        # are not versioned.
810
 
        pred = self.inventory.has_filename
811
 
        return set((p for p in paths if not pred(p)))
 
811
        return set((p for p in paths if self.path2id(p) is None))
812
812
 
813
813
    @needs_read_lock
814
814
    def iter_entries_by_dir(self, specific_file_ids=None, yield_parents=False):