13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
17
# Author: Aaron Bentley <aaron.bentley@utoronto.ca>
236
236
out = self.run_bzr('merge', retcode=3)
237
237
self.assertEquals(out,
238
238
('','bzr: ERROR: No location specified or remembered\n'))
240
# test uncommitted changes
239
# test implicit --remember when no parent set, this merge conflicts
241
240
self.build_tree(['d'])
243
242
self.run_bzr_error(['Working tree ".*" has uncommitted changes'],
246
# merge should now pass and implicitly remember merge location
244
self.assertEquals(abspath(branch_b.get_submit_branch()),
246
# test implicit --remember after resolving conflict
247
247
tree_b.commit('commit d')
248
out, err = self.run_bzr('merge ../branch_a')
248
out, err = self.run_bzr('merge')
250
250
base = urlutils.local_path_from_url(branch_a.base)
251
self.assertEndsWith(err, '+N b\nAll changes applied successfully.\n')
252
self.assertEquals(abspath(branch_b.get_submit_branch()),
254
# test implicit --remember when committing new file
255
self.build_tree(['e'])
257
tree_b.commit('commit e')
258
out, err = self.run_bzr('merge')
259
251
self.assertStartsWith(err,
260
252
'Merging from remembered submit location %s\n' % (base,))
253
self.assertEndsWith(err, '+N b\nAll changes applied successfully.\n')
254
self.assertEquals(abspath(branch_b.get_submit_branch()),
261
256
# re-open tree as external run_bzr modified it
262
257
tree_b = branch_b.bzrdir.open_workingtree()
263
258
tree_b.commit('merge branch_a')
491
486
out, err = self.run_bzr(['merge', '-d', 'a', 'b'])
492
487
self.assertContainsRe(err, 'Warning: criss-cross merge encountered.')
494
def test_merge_force(self):
495
tree_a = self.make_branch_and_tree('a')
496
self.build_tree(['a/foo'])
498
tree_a.commit('add file')
499
tree_b = tree_a.bzrdir.sprout('b').open_workingtree()
500
self.build_tree_contents([('a/foo', 'change 1')])
501
tree_a.commit('change file')
502
tree_b.merge_from_branch(tree_a.branch)
503
tree_a.commit('empty change to allow merge to run')
504
self.run_bzr(['merge', '../a', '--force'], working_dir='b')
506
489
def test_merge_from_submit(self):
507
490
tree_a = self.make_branch_and_tree('a')
508
491
tree_b = tree_a.bzrdir.sprout('b').open_workingtree()