867
867
specific_files=specific_files, require_versioned=False,
868
868
want_unversioned=True))
870
def test_similar_filenames(self):
871
"""Test when we have a few files with similar names."""
872
tree1 = self.make_branch_and_tree('tree1')
873
tree2 = self.make_branch_and_tree('tree2')
874
tree2.set_root_id(tree1.get_root_id())
876
# The trees are actually identical, but they happen to contain
877
# similarly named files.
878
self.build_tree(['tree1/a/',
891
tree1.add(['a', 'a/b', 'a/b/c', 'a/b/c/d', 'a-c', 'a-c/e'],
892
['a-id', 'b-id', 'c-id', 'd-id', 'a-c-id', 'e-id'])
893
tree2.add(['a', 'a/b', 'a/b/c', 'a/b/c/d', 'a-c', 'a-c/e'],
894
['a-id', 'b-id', 'c-id', 'd-id', 'a-c-id', 'e-id'])
896
tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
898
self.assertEqual([], self.do_iter_changes(tree1, tree2,
899
want_unversioned=True))
901
self.unchanged(tree2, tree2.get_root_id()),
902
self.unchanged(tree2, 'a-id'),
903
self.unchanged(tree2, 'b-id'),
904
self.unchanged(tree2, 'c-id'),
905
self.unchanged(tree2, 'd-id'),
906
self.unchanged(tree2, 'a-c-id'),
907
self.unchanged(tree2, 'e-id'),
909
self.assertEqual(expected,
910
self.do_iter_changes(tree1, tree2,
911
want_unversioned=True,
912
include_unchanged=True))
870
915
def test_unversioned_subtree_only_emits_root(self):
871
916
tree1 = self.make_branch_and_tree('tree1')
872
917
tree2 = self.make_to_branch_and_tree('tree2')
1354
1399
self.assertEqual(expected,
1355
1400
self.do_iter_changes(tree1, tree2,
1356
1401
want_unversioned=True))
1403
def test_renamed_and_unknown(self):
1404
"""A file was moved on the filesystem, but not in bzr."""
1405
tree1 = self.make_branch_and_tree('tree1')
1406
tree2 = self.make_to_branch_and_tree('tree2')
1407
root_id = tree1.get_root_id()
1408
tree2.set_root_id(root_id)
1410
# The final changes are:
1414
self.build_tree_contents([
1415
('tree1/a', 'a contents\n'),
1416
('tree1/b', 'b contents\n'),
1417
('tree2/a', 'a contents\n'),
1418
('tree2/b', 'b contents\n'),
1420
tree1.add(['a', 'b'], ['a-id', 'b-id'])
1421
tree2.add(['a', 'b'], ['a-id', 'b-id'])
1422
os.rename('tree2/a', 'tree2/a2')
1424
tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1427
self.missing('a-id', 'a', 'a', tree2.get_root_id(), 'file'),
1428
self.unversioned(tree2, 'a2'),
1430
self.assertEqual(expected,
1431
self.do_iter_changes(tree1, tree2,
1432
want_unversioned=True))