/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

Merge bb-core.

Show diffs side-by-side

added added

removed removed

Lines of Context:
501
501
                (None, basename), (None, kind),
502
502
                (None, False))
503
503
 
 
504
    def not_applicable_if_missing_in(self, relpath, tree):
 
505
        if not tree.path2id(relpath):
 
506
            # The locked test trees conversion could not preserve the missing
 
507
            # file status. This is normal (e.g. InterDirstateTree falls back
 
508
            # to InterTree if the basis is not a DirstateRevisionTree, and
 
509
            # revision trees cannot have missing files. 
 
510
            raise TestNotApplicable()
 
511
 
504
512
    def test_empty_to_abc_content(self):
505
513
        tree1 = self.make_branch_and_tree('1')
506
514
        tree2 = self.make_to_branch_and_tree('2')
690
698
        tree2.add(['directory'], ['file-id'])
691
699
        os.rmdir('tree2/directory')
692
700
        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
 
701
        self.not_applicable_if_missing_in('directory', tree2)
693
702
 
694
703
        root_id = tree1.path2id('')
695
704
        expected = sorted([
705
714
        tree1.add(['file'], ['file-id'])
706
715
        os.unlink('tree1/file')
707
716
        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
 
717
        self.not_applicable_if_missing_in('file', tree1)
708
718
        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
719
        expected = [('file-id', ('file', None), False, (True, False),
716
720
            (root_id, None), ('file', None), (None, None), (False, None))]
717
721
        self.assertEqual(expected, self.do_iter_changes(tree1, tree2))
724
728
        tree2.add(['file'], ['file-id'])
725
729
        os.unlink('tree2/file')
726
730
        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
 
731
        self.not_applicable_if_missing_in('file', tree2)
727
732
        root_id = tree1.path2id('')
728
733
        expected = [('file-id', (None, 'file'), False, (False, True),
729
734
            (None, root_id), (None, 'file'), (None, None), (None, False))]