~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-20 17:41:09 UTC
  • mfrom: (3363.12.9 paths2ids)
  • Revision ID: pqm@pqm.ubuntu.com-20080920174109-rrml3htu12o56j1h
Support path2ids better for PreviewTree

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