696
697
self.assertEqual(expected, self.do_iter_changes(tree1, tree2))
699
def test_only_in_source_and_missing(self):
700
tree1 = self.make_branch_and_tree('tree1')
701
tree2 = self.make_to_branch_and_tree('tree2')
702
tree2.set_root_id(tree1.get_root_id())
703
self.build_tree(['tree1/file'])
704
tree1.add(['file'], ['file-id'])
705
os.unlink('tree1/file')
706
tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
707
root_id = tree1.path2id('')
708
if not tree1.path2id('file'):
709
# The locked test trees conversion could not preserve the missing
710
# file status. This is normal (e.g. InterDirstateTree falls back
711
# to InterTree if the basis is not a DirstateRevisionTree, and
712
# revision trees cannot have missing files.
713
raise TestNotApplicable()
714
expected = [('file-id', ('file', None), False, (True, False),
715
(root_id, None), ('file', None), (None, None), (False, None))]
716
self.assertEqual(expected, self.do_iter_changes(tree1, tree2))
718
def test_only_in_target_and_missing(self):
719
tree1 = self.make_branch_and_tree('tree1')
720
tree2 = self.make_to_branch_and_tree('tree2')
721
tree2.set_root_id(tree1.get_root_id())
722
self.build_tree(['tree2/file'])
723
tree2.add(['file'], ['file-id'])
724
os.unlink('tree2/file')
725
tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
726
root_id = tree1.path2id('')
727
expected = [('file-id', (None, 'file'), False, (False, True),
728
(None, root_id), (None, 'file'), (None, None), (None, False))]
729
self.assertEqual(expected, self.do_iter_changes(tree1, tree2))
698
731
def test_unchanged_with_renames_and_modifications(self):
699
732
"""want_unchanged should generate a list of unchanged entries."""
700
733
tree1 = self.make_branch_and_tree('1')