~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
532
532
        return find_ids_across_trees(paths, [self] + list(trees), require_versioned)
533
533
 
534
534
    def iter_children(self, file_id):
535
 
        """Iterate over the file ids of the children of an entry.
536
 
 
537
 
        :param file_id: File id of the entry
538
 
        :return: Iterator over child file ids.
539
 
        """
540
 
        raise NotImplementedError(self.iter_children)
 
535
        entry = self.iter_entries_by_dir([file_id]).next()[1]
 
536
        for child in getattr(entry, 'children', {}).itervalues():
 
537
            yield child.file_id
541
538
 
542
539
    def lock_read(self):
543
540
        """Lock this tree for multiple read only operations.
544
 
 
 
541
        
545
542
        :return: A bzrlib.lock.LogicalLockResult.
546
543
        """
547
544
        pass
875
872
    def get_file_by_path(self, path):
876
873
        return self.get_file(self.path2id(path), path)
877
874
 
878
 
    def iter_children(self, file_id, path=None):
879
 
        """See Tree.iter_children."""
880
 
        entry = self.iter_entries_by_dir([file_id]).next()[1]
881
 
        for child in getattr(entry, 'children', {}).itervalues():
882
 
            yield child.file_id
883
 
 
884
875
 
885
876
def find_ids_across_trees(filenames, trees, require_versioned=True):
886
877
    """Find the ids corresponding to specified filenames.
1344
1335
                        if old_entry is None:
1345
1336
                            # Reusing a discarded change.
1346
1337
                            old_entry = self._get_entry(self.source, file_id)
1347
 
                        for child in self.source.iter_children(file_id):
1348
 
                            precise_file_ids.add(child)
 
1338
                        for child in old_entry.children.values():
 
1339
                            precise_file_ids.add(child.file_id)
1349
1340
                    changed_file_ids.add(result[0])
1350
1341
                    yield result
1351
1342