1
# Copyright (C) 2006 Canonical Ltd
1
# Copyright (C) 2006 by Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
64
64
def compare(self, want_unchanged=False, specific_files=None,
65
extra_trees=None, require_versioned=False, include_root=False,
66
want_unversioned=False):
65
extra_trees=None, require_versioned=False, include_root=False):
68
67
('compare', self.source, self.target, want_unchanged,
69
68
specific_files, extra_trees, require_versioned,
70
include_root, want_unversioned)
99
98
extra_trees='extra',
100
99
require_versioned='require',
101
100
include_root=True,
102
want_unversioned=True,
105
103
InterTree._optimisers = old_optimisers
106
104
self.assertEqual(
108
('compare', tree2, tree, False, None, None, False, False, False),
109
('compare', tree2, tree, 'unchanged', 'specific', 'extra',
110
'require', True, False),
111
('compare', tree2, tree, 'unchanged', 'specific', 'extra',
112
'require', True, True),
106
('compare', tree2, tree, False, None, None, False, False),
107
('compare', tree2, tree, 'unchanged', 'specific', 'extra',
109
('compare', tree2, tree, 'unchanged', 'specific', 'extra',
113
111
], RecordingOptimiser.calls)
115
def test_changes_from_with_root(self):
116
"""Ensure the include_root option does what's expected."""
117
wt = self.make_branch_and_tree('.')
118
delta = wt.changes_from(wt.basis_tree())
119
self.assertEqual(len(delta.added), 0)
120
delta = wt.changes_from(wt.basis_tree(), wt, include_root=True)
121
self.assertEqual(len(delta.added), 1)
122
self.assertEqual(delta.added[0][0], '')