65
self.calls.append(('compare', self.source, self.target))
64
def compare(self, want_unchanged=False, specific_files=None,
65
extra_trees=None, require_versioned=False):
67
('compare', self.source, self.target, want_unchanged,
68
specific_files, extra_trees, require_versioned)
68
72
def is_compatible(klass, source, target):
72
76
class TestTree(TestCaseWithTransport):
74
78
def test_compare_calls_InterTree_compare(self):
79
"""This test tests the way Tree.compare() uses InterTree."""
75
80
old_optimisers = InterTree._optimisers
77
82
InterTree._optimisers = set()
79
84
InterTree.register_optimiser(RecordingOptimiser)
80
85
tree = self.make_branch_and_tree('1')
81
86
tree2 = self.make_branch_and_tree('2')
87
# do a series of calls:
82
89
tree.changes_from(tree2)
90
# pass in all optional arguments by position
91
tree.changes_from(tree2, 'unchanged', 'specific', 'extra', 'require')
92
# pass in all optional arguments by keyword
93
tree.changes_from(tree2,
94
specific_files='specific',
95
want_unchanged='unchanged',
97
require_versioned='require',
84
100
InterTree._optimisers = old_optimisers
85
self.assertEqual([('compare', tree2, tree)], RecordingOptimiser.calls)
103
('compare', tree2, tree, False, None, None, False),
104
('compare', tree2, tree, 'unchanged', 'specific', 'extra', 'require'),
105
('compare', tree2, tree, 'unchanged', 'specific', 'extra', 'require'),
106
], RecordingOptimiser.calls)