165
165
self.assertEqualDiff('', out)
166
166
self.assertEqualDiff('bzr: ERROR: Cannot perform local-only commits '
167
167
'on unbound branches.\n', err)
169
def test_commit_a_text_merge_in_a_checkout(self):
170
# checkouts perform multiple actions in a transaction across bond
171
# branches and their master, and have been observed to fail in the
172
# past. This is a user story reported to fail in bug #43959 where
173
# a merge done in a checkout (using the update command) failed to
175
self.run_bzr('init', 'trunk')
177
self.run_bzr('checkout', 'trunk', 'u1')
178
self.build_tree_contents([('u1/hosts', 'initial contents')])
179
self.run_bzr('add', 'u1/hosts')
180
self.run_bzr('commit', '-m', 'add hosts', 'u1')
182
self.run_bzr('checkout', 'trunk', 'u2')
183
self.build_tree_contents([('u2/hosts', 'altered in u2')])
184
self.run_bzr('commit', '-m', 'checkin from u2', 'u2')
186
# make an offline commits
187
self.build_tree_contents([('u1/hosts', 'first offline change in u1')])
188
self.run_bzr('commit', '-m', 'checkin offline', '--local', 'u1')
190
# now try to pull in online work from u2, and then commit our offline
192
# retcode 1 as we expect a text conflict
193
self.run_bzr('update', 'u1', retcode=1)
194
self.run_bzr('resolved', 'u1/hosts')
195
# add a text change here to represent resolving the merge conflicts in
196
# favour of a new version of the file not identical to either the u1
197
# version or the u2 version.
198
self.build_tree_contents([('u1/hosts', 'merge resolution\n')])
199
self.run_bzr('commit', '-m', 'checkin merge of the offline work from u1', 'u1')