~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

Convert the test_delta tests to intertree_implementation and workingtree_implementation tests as appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    trees or versioned trees.
52
52
    """
53
53
    
54
 
    def compare(self, other):
55
 
        """Compare this tree with other.
56
 
 
57
 
        :param other: A tre to compare with.
 
54
    def compare(self, other, specific_files=None):
 
55
        """Return the changes from other to this tree.
 
56
 
 
57
        :param other: A tree to compare with.
 
58
        :param specific_files: An optional list of file paths to restrict the
 
59
            comparison to. When mapping filenames to ids, all matches in all
 
60
            trees (including optional extra_trees) are used, and all children of
 
61
            matched directories are included.
 
62
 
58
63
        The comparison will be performed by an InterTree object looked up on 
59
64
        self and other.
60
65
        """
61
 
        return InterTree.get(self, other).compare()
 
66
        return InterTree.get(self, other).compare(specific_files=specific_files)
62
67
    
63
68
    def conflicts(self):
64
69
        """Get a list of the conflicts in the tree.
355
360
 
356
361
    _optimisers = set()
357
362
 
358
 
    def compare(self):
359
 
        """Compare source and target.
 
363
    def compare(self, specific_files=None):
 
364
        """Return the changes from source to target.
360
365
 
361
366
        :return: A TreeDelta.
362
367
        """
363
368
        # imported later to avoid circular imports
364
369
        from bzrlib.delta import compare_trees
365
 
        return compare_trees(self.source, self.target)
 
370
        return compare_trees(
 
371
            self.source,
 
372
            self.target,
 
373
            specific_files=specific_files,
 
374
            )