1
# Copyright (C) 2006 Canonical Ltd
1
# Copyright (C) 2006, 2007 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
21
from bzrlib import errors
21
from bzrlib import errors, tests, workingtree_4
22
22
from bzrlib.tests.intertree_implementations import TestCaseWithTwoTrees
24
24
# TODO: test diff unversioned dir that exists
498
498
(root_id, root_id), ('a', 'd'), ('file', 'file'),
499
499
(False, False)), unchanged('c-id')]),
500
500
self.do_iter_changes(tree1, tree2, include_unchanged=True))
502
def test_compare_subtrees(self):
503
"""want_unchanged should generate a list of unchanged entries."""
504
tree1 = self.make_branch_and_tree('1')
505
tree1.set_root_id('root-id')
506
subtree1 = self.make_branch_and_tree('1/sub')
507
subtree1.set_root_id('subtree-id')
509
tree1.add_reference(subtree1)
510
except errors.UnsupportedOperation:
511
self.assertIsInstance(tree1, workingtree_4.WorkingTree4)
512
raise tests.TestSkipped('Tree does not support references')
514
tree2 = self.make_to_branch_and_tree('2')
515
tree2.set_root_id('root-id')
516
subtree2 = self.make_to_branch_and_tree('2/sub')
517
subtree2.set_root_id('subtree-id')
518
tree2.add_reference(subtree2)
519
self.assertEqual([], list(tree2._iter_changes(tree1)))
520
subtree1.commit('commit', rev_id='commit-a')
521
self.assertEqual([('subtree-id',
525
('root-id', 'root-id'),
527
('tree-reference', 'tree-reference'),
529
list(tree2._iter_changes(tree1)))