267
267
self.pullable_branch()
269
269
(out, err) = self.run_bzr('merge --pull ../b')
270
self.assertContainsRe(err, 'Now on revision 2\\.')
270
self.assertContainsRe(out, 'Now on revision 2\\.')
271
271
tree_a = WorkingTree.open('.')
272
272
self.assertEqual([self.id2], tree_a.get_parent_ids())
331
331
mangle_patch=True)
332
332
err = self.run_bzr('merge -d target directive')[1]
333
333
self.assertContainsRe(err, 'Preview patch does not match changes')
335
def test_merge_arbitrary(self):
336
target = self.make_branch_and_tree('target')
337
target.commit('empty')
338
# We need a revision that has no integer revno
339
branch_a = target.bzrdir.sprout('branch_a').open_workingtree()
340
self.build_tree(['branch_a/file1'])
341
branch_a.add('file1')
342
branch_a.commit('added file1', rev_id='rev2a')
343
branch_b = target.bzrdir.sprout('branch_b').open_workingtree()
344
self.build_tree(['branch_b/file2'])
345
branch_b.add('file2')
346
branch_b.commit('added file2', rev_id='rev2b')
347
branch_b.merge_from_branch(branch_a.branch)
348
self.failUnlessExists('branch_b/file1')
349
branch_b.commit('merged branch_a', rev_id='rev3b')
351
# It works if the revid has an interger revno
352
self.run_bzr('merge -d target -r revid:rev2a branch_a')
353
self.failUnlessExists('target/file1')
354
self.failIfExists('target/file2')
357
# It should work if the revid has no integer revno
358
self.run_bzr('merge -d target -r revid:rev2a branch_b')
359
self.failUnlessExists('target/file1')
360
self.failIfExists('target/file2')