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