~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2011-05-26 08:05:45 UTC
  • mfrom: (5916 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5917.
  • Revision ID: john@arbash-meinel.com-20110526080545-5tprxfczyj4bfk0o
Merge bzr.dev 5916 and make sure the right patch is applied.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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
 
557
560
 
558
561
    def test_no_remember_dont_set_submit(self):
559
562
        tree_a = self.make_branch_and_tree('a')
 
563
        self.build_tree_contents([('a/file', "a\n")])
 
564
        tree_a.add('file')
 
565
        tree_a.commit('rev1')
560
566
        tree_b = tree_a.bzrdir.sprout('b').open_workingtree()
561
567
        self.assertIs(tree_b.branch.get_submit_branch(), None)
562
568
 
638
644
 
639
645
    def test_merge_interactive_unlocks_branch(self):
640
646
        this = self.make_branch_and_tree('this')
641
 
        other = self.make_branch_and_tree('other')
642
 
        other.commit('empty commit')
 
647
        this.commit('empty commit')
 
648
        other = this.bzrdir.sprout('other').open_workingtree()
 
649
        other.commit('empty commit 2')
643
650
        self.run_bzr('merge -i -d this other')
644
651
        this.lock_write()
645
652
        this.unlock()
677
684
        self.assertEqual('rev-2a', target.tags.lookup_tag('tag-a'))
678
685
        target.repository.get_revision('rev-2a')
679
686
 
 
687
class TestMergeScript(script.TestCaseWithTransportAndScript):
 
688
    def test_merge_empty_branch(self):
 
689
        source = self.make_branch_and_tree('source')
 
690
        self.build_tree(['source/a'])
 
691
        source.add('a')
 
692
        source.commit('Added a', rev_id='rev1')
 
693
        target = self.make_branch_and_tree('target')
 
694
        self.run_script("""\
 
695
$ bzr merge -d target source
 
696
2>bzr: ERROR: Merging into empty branches not currently supported, https://bugs.launchpad.net/bzr/+bug/308562
 
697
""")
680
698
 
681
699
class TestMergeForce(tests.TestCaseWithTransport):
682
700