~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-13 18:38:58 UTC
  • mfrom: (1863 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1869.
  • Revision ID: john@arbash-meinel.com-20060713183858-ebf4aa1f9ef8bb6e
[merge] bzr.dev 1863

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
                            delete_any)
27
27
from bzrlib.progress import DummyProgress, ProgressPhase
28
28
from bzrlib.trace import mutter, warning
 
29
from bzrlib import tree
29
30
import bzrlib.ui 
30
31
import bzrlib.urlutils as urlutils
31
32
 
999
1000
def find_interesting(working_tree, target_tree, filenames):
1000
1001
    """Find the ids corresponding to specified filenames."""
1001
1002
    trees = (working_tree, target_tree)
1002
 
    if not filenames:
1003
 
        interesting_ids = None
1004
 
    else:
1005
 
        interesting_ids = set()
1006
 
        for tree_path in filenames:
1007
 
            not_found = True
1008
 
            for tree in trees:
1009
 
                file_id = tree.inventory.path2id(tree_path)
1010
 
                if file_id is not None:
1011
 
                    interesting_ids.add(file_id)
1012
 
                    not_found = False
1013
 
            if not_found:
1014
 
                raise NotVersionedError(path=tree_path)
1015
 
        
1016
 
        pending = interesting_ids
1017
 
        # now handle children of interesting ids
1018
 
        # we loop so that we handle all children of each id in both trees
1019
 
        while len(pending) > 0:
1020
 
            new_pending = set()
1021
 
            for file_id in pending:
1022
 
                for tree in trees:
1023
 
                    if file_id not in tree:
1024
 
                        continue
1025
 
                    entry = tree.inventory[file_id]
1026
 
                    for child in getattr(entry, 'children', {}).itervalues():
1027
 
                        if child.file_id not in interesting_ids:
1028
 
                            new_pending.add(child.file_id)
1029
 
            interesting_ids.update(new_pending)
1030
 
            pending = new_pending
1031
 
    return interesting_ids
 
1003
    return tree.find_ids_across_trees(filenames, trees)
1032
1004
 
1033
1005
 
1034
1006
def change_entry(tt, file_id, working_tree, target_tree,