~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Patch Queue Manager
  • Date: 2012-04-02 02:36:45 UTC
  • mfrom: (6471.1.7 iter-child-entries)
  • Revision ID: pqm@pqm.ubuntu.com-20120402023645-28dkcb0awh3i1flc
(jelmer) Add Tree.iter_child_entries(). (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

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