~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-31 12:22:44 UTC
  • mfrom: (1551.15.77 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20070731122244-f1jemfecukeevugw
Clean up merge command, support arbitrary revisions

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
        self.pullable_branch()
268
268
        os.chdir('a')
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())
273
273
 
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')
 
334
 
 
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')
 
350
 
 
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')
 
355
        target.revert([])
 
356
 
 
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')