~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-04-09 20:23:07 UTC
  • mfrom: (4265.1.4 bbc-merge)
  • Revision ID: pqm@pqm.ubuntu.com-20090409202307-n0depb16qepoe21o
(jam) Change _fetch_uses_deltas = False for CHK repos until we can
        write a better fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
 
118
118
    def test_create_rename(self):
119
119
        """Rename an inventory entry while creating the file"""
120
 
        self.thisFailsStrictLockCheck()
121
120
        tree =self.make_branch_and_tree('.')
122
121
        file('name1', 'wb').write('Hello')
123
122
        tree.add('name1')
128
127
 
129
128
    def test_layered_rename(self):
130
129
        """Rename both child and parent at same time"""
131
 
        self.thisFailsStrictLockCheck()
132
130
        tree =self.make_branch_and_tree('.')
133
131
        os.mkdir('dirname1')
134
132
        tree.add('dirname1')
215
213
        self.assertFileEqual('text2', 'tree/sub-tree/file')
216
214
 
217
215
    def test_merge_with_missing(self):
218
 
        self.thisFailsStrictLockCheck()
219
216
        tree_a = self.make_branch_and_tree('tree_a')
220
217
        self.build_tree_contents([('tree_a/file', 'content_1')])
221
218
        tree_a.add('file')
1098
1095
            '>>>>>>> MERGE-SOURCE\n'
1099
1096
            'line 4\n', 'this/file1')
1100
1097
 
1101
 
    def test_modify_conflicts_with_delete(self):
1102
 
        # If one side deletes a line, and the other modifies that line, then
1103
 
        # the modification should be considered a conflict
1104
 
        builder = self.make_branch_builder('test')
1105
 
        builder.start_series()
1106
 
        builder.build_snapshot('BASE-id', None,
1107
 
            [('add', ('', None, 'directory', None)),
1108
 
             ('add', ('foo', 'foo-id', 'file', 'a\nb\nc\nd\ne\n')),
1109
 
            ])
1110
 
        # Delete 'b\n'
1111
 
        builder.build_snapshot('OTHER-id', ['BASE-id'],
1112
 
            [('modify', ('foo-id', 'a\nc\nd\ne\n'))])
1113
 
        # Modify 'b\n', add 'X\n'
1114
 
        builder.build_snapshot('THIS-id', ['BASE-id'],
1115
 
            [('modify', ('foo-id', 'a\nb2\nc\nd\nX\ne\n'))])
1116
 
        builder.finish_series()
1117
 
        branch = builder.get_branch()
1118
 
        this_tree = branch.bzrdir.create_workingtree()
1119
 
        this_tree.lock_write()
1120
 
        self.addCleanup(this_tree.unlock)
1121
 
        other_tree = this_tree.bzrdir.sprout('other', 'OTHER-id').open_workingtree()
1122
 
        self.do_merge(this_tree, other_tree)
1123
 
        if self.merge_type is _mod_merge.LCAMerger:
1124
 
            self.expectFailure("lca merge doesn't track deleted lines",
1125
 
                self.assertFileEqual,
1126
 
                    'a\n'
1127
 
                    '<<<<<<< TREE\n'
1128
 
                    'b2\n'
1129
 
                    '=======\n'
1130
 
                    '>>>>>>> MERGE-SOURCE\n'
1131
 
                    'c\n'
1132
 
                    'd\n'
1133
 
                    'X\n'
1134
 
                    'e\n', 'test/foo')
1135
 
        else:
1136
 
            self.assertFileEqual(
1137
 
                'a\n'
1138
 
                '<<<<<<< TREE\n'
1139
 
                'b2\n'
1140
 
                '=======\n'
1141
 
                '>>>>>>> MERGE-SOURCE\n'
1142
 
                'c\n'
1143
 
                'd\n'
1144
 
                'X\n'
1145
 
                'e\n', 'test/foo')
1146
 
 
1147
1098
 
1148
1099
class TestMerge3Merge(TestCaseWithTransport, TestMergeImplementation):
1149
1100