~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
948
948
                           (False, True))],
949
949
                         self.do_iter_changes(tree1, tree2))
950
950
 
 
951
    def test_file_becomes_unversionable_bug_438569(self):
 
952
        # This isn't strictly a intertree problem, but its the intertree code
 
953
        # path that triggers all stat cache updates on both xml and dirstate
 
954
        # trees.
 
955
        # In bug 438569, a file becoming a fifo causes an assert. Fifo's are
 
956
        # not versionable or diffable. For now, we simply stop cold when they
 
957
        # are detected (because we don't know how far through the code the 
 
958
        # assumption 'fifo's do not exist' goes). In future we could report 
 
959
        # the kind change and have commit refuse to go futher, or something
 
960
        # similar. One particular reason for choosing this approach is that
 
961
        # there is no minikind for 'fifo' in dirstate today, so we can't 
 
962
        # actually update records that way.
 
963
        # To add confusion, the totally generic code path works - but it
 
964
        # doesn't update persistent metadata. So this test permits InterTrees
 
965
        # to either work, or fail with BadFileKindError.
 
966
        self.requireFeature(tests.OsFifoFeature)
 
967
        tree1 = self.make_branch_and_tree('1')
 
968
        self.build_tree(['1/a'])
 
969
        tree1.set_root_id('root-id')
 
970
        tree1.add(['a'], ['a-id'])
 
971
        tree2 = self.make_branch_and_tree('2')
 
972
        os.mkfifo('2/a')
 
973
        tree2.add(['a'], ['a-id'], ['file'])
 
974
        try:
 
975
            tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)
 
976
        except (KeyError,):
 
977
            raise tests.TestNotApplicable(
 
978
                "Cannot represent a FIFO in this case %s" % self.id())
 
979
        try:
 
980
            self.do_iter_changes(tree1, tree2)
 
981
        except errors.BadFileKindError:
 
982
            pass
 
983
 
951
984
    def test_missing_in_target(self):
952
985
        """Test with the target files versioned but absent from disk."""
953
986
        tree1 = self.make_branch_and_tree('1')