~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jonathan Riddell
  • Date: 2011-05-16 17:31:08 UTC
  • mto: This revision was merged to the branch mainline in revision 5897.
  • Revision ID: jriddell@canonical.com-20110516173108-7vd2h6c7bof88tct
add an error message when merging into empty branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    urlutils,
35
35
    workingtree,
36
36
    )
 
37
from bzrlib.tests import script
37
38
 
38
39
 
39
40
class TestMerge(tests.TestCaseWithTransport):
533
534
 
534
535
    def test_merge_from_submit(self):
535
536
        tree_a = self.make_branch_and_tree('a')
 
537
        tree_a.commit('test')
536
538
        tree_b = tree_a.bzrdir.sprout('b').open_workingtree()
537
539
        tree_c = tree_a.bzrdir.sprout('c').open_workingtree()
538
540
        out, err = self.run_bzr(['merge', '-d', 'c'])
543
545
 
544
546
    def test_remember_sets_submit(self):
545
547
        tree_a = self.make_branch_and_tree('a')
 
548
        tree_a.commit('rev1')
546
549
        tree_b = tree_a.bzrdir.sprout('b').open_workingtree()
547
550
        self.assertIs(tree_b.branch.get_submit_branch(), None)
548
551
 
624
627
 
625
628
    def test_merge_interactive_unlocks_branch(self):
626
629
        this = self.make_branch_and_tree('this')
627
 
        other = self.make_branch_and_tree('other')
628
 
        other.commit('empty commit')
 
630
        this.commit('empty commit')
 
631
        other = this.bzrdir.sprout('other').open_workingtree()
 
632
        other.commit('empty commit 2')
629
633
        self.run_bzr('merge -i -d this other')
630
634
        this.lock_write()
631
635
        this.unlock()
663
667
        self.assertEqual('rev-2a', target.tags.lookup_tag('tag-a'))
664
668
        target.repository.get_revision('rev-2a')
665
669
 
 
670
class TestMergeScript(script.TestCaseWithTransportAndScript):
 
671
    def test_merge_empty_branch(self):
 
672
        source = self.make_branch_and_tree('source')
 
673
        self.build_tree(['source/a'])
 
674
        source.add('a')
 
675
        source.commit('Added a', rev_id='rev1')
 
676
        target = self.make_branch_and_tree('target')
 
677
        self.run_script("""\
 
678
$ bzr merge -d target source
 
679
2>bzr: ERROR: Merging into empty branches not currently supported, https://bugs.launchpad.net/bzr/+bug/308562
 
680
""")
666
681
 
667
682
class TestMergeForce(tests.TestCaseWithTransport):
668
683