37
37
self.build_tree(['hello.txt'])
38
38
self.runbzr("commit -m empty", retcode=3)
40
def test_commit_with_path(self):
41
"""Commit tree with path of root specified"""
42
self.run_bzr('init', 'a')
43
self.build_tree(['a/a_file'])
44
self.run_bzr('add', 'a/a_file')
45
self.run_bzr('commit', '-m', 'first commit', 'a')
47
self.run_bzr('branch', 'a', 'b')
48
self.build_tree_contents([('b/a_file', 'changes in b')])
49
self.run_bzr('commit', '-m', 'first commit in b', 'b')
51
self.build_tree_contents([('a/a_file', 'new contents')])
52
self.run_bzr('commit', '-m', 'change in a', 'a')
55
self.run_bzr('merge', '../a', retcode=1) # will conflict
57
self.run_bzr('resolved', 'b/a_file')
58
self.run_bzr('commit', '-m', 'merge into b', 'b')
40
61
def test_10_verbose_commit(self):
41
62
"""Add one file and examine verbose commit output"""
42
63
self.runbzr("init")
165
186
self.assertEqualDiff('', out)
166
187
self.assertEqualDiff('bzr: ERROR: Cannot perform local-only commits '
167
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')