~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Robey Pointer
  • Date: 2006-07-01 19:03:33 UTC
  • mfrom: (1829 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1830.
  • Revision ID: robey@lag.net-20060701190333-f58465aec4bd3412
merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
539
539
        if child_id is None:
540
540
            return lexists(self._tree.abspath(childpath))
541
541
        else:
542
 
            if tt.final_parent(child_id) != parent_id:
 
542
            if self.final_parent(child_id) != parent_id:
543
543
                return False
544
 
            if child_id in tt._removed_contents:
 
544
            if child_id in self._removed_contents:
545
545
                # XXX What about dangling file-ids?
546
546
                return False
547
547
            else:
987
987
 
988
988
def find_interesting(working_tree, target_tree, filenames):
989
989
    """Find the ids corresponding to specified filenames."""
 
990
    trees = (working_tree, target_tree)
990
991
    if not filenames:
991
992
        interesting_ids = None
992
993
    else:
993
994
        interesting_ids = set()
994
995
        for tree_path in filenames:
995
996
            not_found = True
996
 
            for tree in (working_tree, target_tree):
 
997
            for tree in trees:
997
998
                file_id = tree.inventory.path2id(tree_path)
998
999
                if file_id is not None:
999
1000
                    interesting_ids.add(file_id)
1000
1001
                    not_found = False
1001
1002
            if not_found:
1002
1003
                raise NotVersionedError(path=tree_path)
 
1004
        
 
1005
        pending = interesting_ids
 
1006
        # now handle children of interesting ids
 
1007
        # we loop so that we handle all children of each id in both trees
 
1008
        while len(pending) > 0:
 
1009
            new_pending = set()
 
1010
            for file_id in pending:
 
1011
                for tree in trees:
 
1012
                    if file_id not in tree:
 
1013
                        continue
 
1014
                    entry = tree.inventory[file_id]
 
1015
                    for child in getattr(entry, 'children', {}).itervalues():
 
1016
                        if child.file_id not in interesting_ids:
 
1017
                            new_pending.add(child.file_id)
 
1018
            interesting_ids.update(new_pending)
 
1019
            pending = new_pending
1003
1020
    return interesting_ids
1004
1021
 
1005
1022