186
186
self.assertEqualDiff('', out)
187
187
self.assertEqualDiff('bzr: ERROR: Cannot perform local-only commits '
188
188
'on unbound branches.\n', err)
190
def test_commit_a_text_merge_in_a_checkout(self):
191
# checkouts perform multiple actions in a transaction across bond
192
# branches and their master, and have been observed to fail in the
193
# past. This is a user story reported to fail in bug #43959 where
194
# a merge done in a checkout (using the update command) failed to
196
self.run_bzr('init', 'trunk')
198
self.run_bzr('checkout', 'trunk', 'u1')
199
self.build_tree_contents([('u1/hosts', 'initial contents')])
200
self.run_bzr('add', 'u1/hosts')
201
self.run_bzr('commit', '-m', 'add hosts', 'u1')
203
self.run_bzr('checkout', 'trunk', 'u2')
204
self.build_tree_contents([('u2/hosts', 'altered in u2')])
205
self.run_bzr('commit', '-m', 'checkin from u2', 'u2')
207
# make an offline commits
208
self.build_tree_contents([('u1/hosts', 'first offline change in u1')])
209
self.run_bzr('commit', '-m', 'checkin offline', '--local', 'u1')
211
# now try to pull in online work from u2, and then commit our offline
213
# retcode 1 as we expect a text conflict
214
self.run_bzr('update', 'u1', retcode=1)
215
self.run_bzr('resolved', 'u1/hosts')
216
# add a text change here to represent resolving the merge conflicts in
217
# favour of a new version of the file not identical to either the u1
218
# version or the u2 version.
219
self.build_tree_contents([('u1/hosts', 'merge resolution\n')])
220
self.run_bzr('commit', '-m', 'checkin merge of the offline work from u1', 'u1')