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')
215
213
self.assertFileEqual('text2', 'tree/sub-tree/file')
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')
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')),
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,
1130
'>>>>>>> MERGE-SOURCE\n'
1136
self.assertFileEqual(
1141
'>>>>>>> MERGE-SOURCE\n'
1148
1099
class TestMerge3Merge(TestCaseWithTransport, TestMergeImplementation):