1318
1318
self.assertEqual(expected,
1319
1319
self.do_iter_changes(tree1, tree2,
1320
1320
want_unversioned=False))
1322
def test_renamed_and_added(self):
1323
"""Test when we have renamed a file, and put another in its place."""
1324
tree1 = self.make_branch_and_tree('tree1')
1325
tree2 = self.make_to_branch_and_tree('tree2')
1326
root_id = tree1.get_root_id()
1327
tree2.set_root_id(root_id)
1329
# The final changes are:
1335
self.build_tree_contents([
1336
('tree1/b', 'b contents\n'),
1337
('tree1/c', 'c contents\n'),
1338
('tree2/a', 'b contents\n'),
1339
('tree2/b', 'new b contents\n'),
1340
('tree2/c', 'new c contents\n'),
1341
('tree2/d', 'c contents\n'),
1343
tree1.add(['b', 'c'], ['b1-id', 'c1-id'])
1344
tree2.add(['a', 'b', 'c', 'd'], ['b1-id', 'b2-id', 'c2-id', 'c1-id'])
1346
tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1349
self.renamed(tree1, tree2, 'b1-id', False),
1350
self.renamed(tree1, tree2, 'c1-id', False),
1351
self.added(tree2, 'b2-id'),
1352
self.added(tree2, 'c2-id'),
1354
self.assertEqual(expected,
1355
self.do_iter_changes(tree1, tree2,
1356
want_unversioned=True))