~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/intertree_implementations/test_compare.py

  • Committer: Aaron Bentley
  • Date: 2007-01-12 04:48:18 UTC
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20070112044818-nnw6iunriqq073qc
Implement tree comparison for tree references

Show diffs side-by-side

added added

removed removed

Lines of Context:
391
391
                          (False, False)), unchanged('c-id')],
392
392
                         list(tree2._iter_changes(tree1, 
393
393
                                                 include_unchanged=True)))
 
394
 
 
395
    def test_compare_subtrees(self):
 
396
        """want_unchanged should generate a list of unchanged entries."""
 
397
        tree1 = self.make_branch_and_tree('1')
 
398
        tree1.set_root_id('root-id')
 
399
        subtree1 = self.make_branch_and_tree('1/sub')
 
400
        subtree1.set_root_id('subtree-id')
 
401
        tree1.add_reference(subtree1)
 
402
 
 
403
        tree2 = self.make_to_branch_and_tree('2')
 
404
        tree2.set_root_id('root-id')
 
405
        subtree2 = self.make_to_branch_and_tree('2/sub')
 
406
        subtree2.set_root_id('subtree-id')
 
407
        tree2.add_reference(subtree2)
 
408
        self.assertEqual([], list(tree2._iter_changes(tree1)))
 
409
        subtree1.commit('commit', rev_id='commit-a')
 
410
        self.assertEqual([('subtree-id',
 
411
                           'sub',
 
412
                           True,
 
413
                           (True, True),
 
414
                           ('root-id', 'root-id'),
 
415
                           ('sub', 'sub'),
 
416
                           ('tree-reference', 'tree-reference'),
 
417
                           (False, False))], 
 
418
                         list(tree2._iter_changes(tree1)))