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