~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Robert Collins
  • Date: 2006-07-25 06:19:05 UTC
  • mto: (1852.7.4 split-tree-source)
  • mto: This revision was merged to the branch mainline in revision 1890.
  • Revision ID: robertc@robertcollins.net-20060725061905-b1ab0530dcca0238
Add more test trees to the tree-implementations tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
    def has_id(self, file_id):
74
74
        return self.inventory.has_id(file_id)
75
75
 
 
76
    __contains__ = has_id
 
77
 
76
78
    def has_or_had_id(self, file_id):
77
79
        if file_id == self.inventory.root.file_id:
78
80
            return True
79
81
        return self.inventory.has_id(file_id)
80
82
 
81
 
    __contains__ = has_id
82
 
 
83
83
    def __iter__(self):
84
84
        return iter(self.inventory)
85
85
 
86
86
    def id2path(self, file_id):
87
87
        return self.inventory.id2path(file_id)
88
88
 
 
89
    def iter_entries_by_dir(self):
 
90
        """Walk the tree in 'by_dir' order.
 
91
 
 
92
        This will yield each entry in the tree as a (path, entry) tuple. The
 
93
        order that they are yielded is: the contents of a directory are 
 
94
        preceeded by the parent of a directory, and all the contents of a 
 
95
        directory are grouped together.
 
96
        """
 
97
        return self.inventory.iter_entries_by_dir()
 
98
 
89
99
    def kind(self, file_id):
90
100
        raise NotImplementedError("subclasses must implement kind")
91
101