~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-21 12:51:25 UTC
  • mfrom: (6468.3.1 bzr)
  • mto: This revision was merged to the branch mainline in revision 6519.
  • Revision ID: jelmer@samba.org-20120221125125-7cpkwjmvf3aj2d9x
MergeĀ lp:~jelmer/bzr/use-tree-iter-children

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
        """
196
196
        raise NotImplementedError(self.iter_entries_by_dir)
197
197
 
198
 
    def iter_child_entries(self, file_id, path=None):
199
 
        """Iterate over the children of a directory or tree reference.
200
 
 
201
 
        :param file_id: File id of the directory/tree-reference
202
 
        :param path: Optional path of the directory
203
 
        :raise NoSuchId: When the file_id does not exist
204
 
        :return: Iterator over entries in the directory
205
 
        """
206
 
        raise NotImplementedError(self.iter_child_entries)
207
 
 
208
198
    def list_files(self, include_root=False, from_dir=None, recursive=True):
209
199
        """List all files in this tree.
210
200
 
881
871
        return self.root_inventory.iter_entries_by_dir(
882
872
            specific_file_ids=inventory_file_ids, yield_parents=yield_parents)
883
873
 
884
 
    @needs_read_lock
885
 
    def iter_child_entries(self, file_id, path=None):
886
 
        inv, inv_file_id = self._unpack_file_id(file_id)
887
 
        return inv[inv_file_id].children.itervalues()
888
 
 
889
874
    @deprecated_method(deprecated_in((2, 5, 0)))
890
875
    def get_file_by_path(self, path):
891
876
        return self.get_file(self.path2id(path), path)
1359
1344
                        if old_entry is None:
1360
1345
                            # Reusing a discarded change.
1361
1346
                            old_entry = self._get_entry(self.source, file_id)
1362
 
                        precise_file_ids.update(
1363
 
                                self.source.iter_children(file_id))
 
1347
                        for child in self.source.iter_children(file_id):
 
1348
                            precise_file_ids.add(child.file_id)
1364
1349
                    changed_file_ids.add(result[0])
1365
1350
                    yield result
1366
1351