700
700
self.do_iter_changes(tree1, tree2, include_unchanged=True))
702
702
def test_compare_subtrees(self):
703
"""want_unchanged should generate a list of unchanged entries."""
704
703
tree1 = self.make_branch_and_tree('1')
705
704
if not tree1.supports_tree_reference():
706
raise tests.TestSkipped('Tree %s does not support references'
708
706
tree1.set_root_id('root-id')
709
707
subtree1 = self.make_branch_and_tree('1/sub')
710
708
subtree1.set_root_id('subtree-id')
713
711
tree2 = self.make_to_branch_and_tree('2')
714
712
if not tree2.supports_tree_reference():
715
raise tests.TestSkipped('Tree %s does not support references'
717
714
tree2.set_root_id('root-id')
718
715
subtree2 = self.make_to_branch_and_tree('2/sub')
719
716
subtree2.set_root_id('subtree-id')
745
742
list(tree2._iter_changes(tree1,
746
743
include_unchanged=True)))
745
def test_disk_in_subtrees_skipped(self):
746
"""subtrees are considered not-in-the-current-tree.
748
This test tests the trivial case, where the basis has no paths in the
749
current trees subtree.
751
tree1 = self.make_branch_and_tree('1')
752
tree1.set_root_id('root-id')
753
tree2 = self.make_to_branch_and_tree('2')
754
if not tree2.supports_tree_reference():
756
tree2.set_root_id('root-id')
757
subtree2 = self.make_to_branch_and_tree('2/sub')
758
subtree2.set_root_id('subtree-id')
759
tree2.add(['sub'], ['subtree-id'])
760
self.build_tree(['2/sub/file'])
761
subtree2.add(['file'])
762
tree1, tree2 = self.mutable_trees_to_test_trees(tree1, tree2)
764
self.addCleanup(tree1.unlock)
766
self.addCleanup(tree2.unlock)
767
# this should filter correctly from above
768
self.assertEqual([self.added(tree2, 'subtree-id')],
769
self.do_iter_changes(tree1, tree2, want_unversioned=True))
770
# and when the path is named
771
self.assertEqual([self.added(tree2, 'subtree-id')],
772
self.do_iter_changes(tree1, tree2, specific_files=['sub'],
773
want_unversioned=True))
748
775
def test_default_ignores_unversioned_files(self):
749
776
tree1 = self.make_branch_and_tree('tree1')
750
777
tree2 = self.make_to_branch_and_tree('tree2')