~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
455
455
        """
456
456
        return find_ids_across_trees(paths, [self] + list(trees), require_versioned)
457
457
 
 
458
    def iter_children(self, file_id):
 
459
        entry = self.iter_entries_by_dir([file_id]).next()[1]
 
460
        for child in getattr(entry, 'children', {}).itervalues():
 
461
            yield child.file_id
 
462
 
458
463
    @symbol_versioning.deprecated_method(symbol_versioning.one_six)
459
464
    def print_file(self, file_id):
460
465
        """Print file with id `file_id` to stdout."""
719
724
            for tree in trees:
720
725
                if not tree.has_id(file_id):
721
726
                    continue
722
 
                entry = tree.inventory[file_id]
723
 
                for child in getattr(entry, 'children', {}).itervalues():
724
 
                    if child.file_id not in interesting_ids:
725
 
                        new_pending.add(child.file_id)
 
727
                for child_id in tree.iter_children(file_id):
 
728
                    if child_id not in interesting_ids:
 
729
                        new_pending.add(child_id)
726
730
        interesting_ids.update(new_pending)
727
731
        pending = new_pending
728
732
    return interesting_ids
831
835
        else:
832
836
            all_unversioned = deque()
833
837
        to_paths = {}
834
 
        from_entries_by_dir = list(self.source.inventory.iter_entries_by_dir(
 
838
        from_entries_by_dir = list(self.source.iter_entries_by_dir(
835
839
            specific_file_ids=specific_file_ids))
836
840
        from_data = dict((e.file_id, (p, e)) for p, e in from_entries_by_dir)
837
 
        to_entries_by_dir = list(self.target.inventory.iter_entries_by_dir(
 
841
        to_entries_by_dir = list(self.target.iter_entries_by_dir(
838
842
            specific_file_ids=specific_file_ids))
839
843
        num_entries = len(from_entries_by_dir) + len(to_entries_by_dir)
840
844
        entry_count = 0
932
936
            if file_id in to_paths:
933
937
                # already returned
934
938
                continue
935
 
            if not file_id in self.target.inventory:
 
939
            if not file_id in self.target.all_file_ids():
936
940
                # common case - paths we have not emitted are not present in
937
941
                # target.
938
942
                to_path = None