~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-21 13:35:17 UTC
  • mto: This revision was merged to the branch mainline in revision 6519.
  • Revision ID: jelmer@samba.org-20120221133517-pa3qqwyhrcl0gcqu
Add Tree.iter_child_entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2183
2183
                ordered_ids.append((trans_id, parent_file_id))
2184
2184
        return ordered_ids
2185
2185
 
 
2186
    def iter_child_entries(self, file_id, path=None):
 
2187
        self.id2path(file_id)
 
2188
        trans_id = self._transform.trans_id_file_id(file_id)
 
2189
        todo = [(child_trans_id, trans_id) for child_trans_id in
 
2190
                self._all_children(trans_id)]
 
2191
        for entry, trans_id in self._make_inv_entries(todo):
 
2192
            yield entry
 
2193
 
2186
2194
    def iter_entries_by_dir(self, specific_file_ids=None, yield_parents=False):
2187
2195
        # This may not be a maximally efficient implementation, but it is
2188
2196
        # reasonably straightforward.  An implementation that grafts the