76
72
$ brz conflicts -d branch
79
def test_bug_842575_manual_rm(self):
82
$ echo original > trunk/foo
83
$ brz add -q trunk/foo
84
$ brz commit -q -m first trunk
85
$ brz checkout -q trunk tree
87
$ brz commit -q -m second trunk
88
$ echo modified > tree/foo
91
2>Contents conflict in foo
92
2>1 conflicts encountered.
93
2>Updated to revision 2 of branch ...
94
$ rm tree/foo.BASE tree/foo.THIS
95
$ brz resolve --all -d tree
96
2>1 conflict resolved, 0 remaining
102
except AssertionError:
103
raise KnownFailure("bug #842575")
105
def test_bug_842575_take_other(self):
108
$ echo original > trunk/foo
109
$ brz add -q trunk/foo
110
$ brz commit -q -m first trunk
111
$ brz checkout -q --lightweight trunk tree
112
$ brz rm -q trunk/foo
113
$ brz ignore -d trunk foo
114
$ brz commit -q -m second trunk
115
$ echo modified > tree/foo
119
2>Contents conflict in foo
120
2>1 conflicts encountered.
121
2>Updated to revision 2 of branch ...
122
$ brz resolve --take-other --all -d tree
123
2>1 conflict resolved, 0 remaining
128
$ echo mustignore > tree/foo
131
except AssertionError:
132
raise KnownFailure("bug 842575")
135
76
class TestBug788000(script.TestCaseWithTransportAndScript):
176
117
"""Text conflicts can be resolved automatically"""
177
118
tree = self.make_branch_and_tree('tree')
178
119
self.build_tree_contents([('tree/file',
179
b'<<<<<<<\na\n=======\n>>>>>>>\n')])
180
tree.add('file', b'file_id')
181
self.assertEqual(tree.kind('file'), 'file')
182
file_conflict = _mod_bzr_conflicts.TextConflict('file', file_id=b'file_id')
183
tree.set_conflicts([file_conflict])
120
'<<<<<<<\na\n=======\n>>>>>>>\n')])
121
tree.add('file', 'file_id')
122
self.assertEqual(tree.kind('file_id'), 'file')
123
file_conflict = conflicts.TextConflict('file', file_id='file_id')
124
tree.set_conflicts(conflicts.ConflictList([file_conflict]))
184
125
note = self.run_bzr('resolve', retcode=1, working_dir='tree')[1]
185
126
self.assertContainsRe(note, '0 conflicts auto-resolved.')
186
127
self.assertContainsRe(note,
187
'Remaining conflicts:\nText conflict in file')
188
self.build_tree_contents([('tree/file', b'a\n')])
128
'Remaining conflicts:\nText conflict in file')
129
self.build_tree_contents([('tree/file', 'a\n')])
189
130
note = self.run_bzr('resolve', working_dir='tree')[1]
190
131
self.assertContainsRe(note, 'All conflicts resolved.')