~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2011-06-19 02:24:39 UTC
  • mfrom: (5985 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6001.
  • Revision ID: mbp@canonical.com-20110619022439-u68683yb2bw302x0
resolve conflicts against trunk

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
from bzrlib.tests import (
 
38
    scenarios,
 
39
    script,
 
40
    )
 
41
 
 
42
 
 
43
load_tests = scenarios.load_tests_apply_scenarios
38
44
 
39
45
 
40
46
class TestMerge(tests.TestCaseWithTransport):
662
668
        this.lock_write()
663
669
        this.unlock()
664
670
 
665
 
    def test_merge_reversed_revision_range(self):
666
 
        tree = self.make_branch_and_tree(".")
667
 
        for f in ("a", "b"):
668
 
            self.build_tree([f])
669
 
            tree.add(f)
670
 
            tree.commit("added "+f)
671
 
        for context in (".", "", "a"):
672
 
            self.run_bzr("merge -r 1..0 " + context)
673
 
            self.assertPathDoesNotExist("a")
674
 
            tree.revert()
675
 
            self.assertPathExists("a")
676
 
 
677
671
    def test_merge_fetches_tags(self):
678
672
        """Tags are updated by merge, and revisions named in those tags are
679
673
        fetched.
695
689
        self.assertEqual('rev-2a', target.tags.lookup_tag('tag-a'))
696
690
        target.repository.get_revision('rev-2a')
697
691
 
 
692
 
 
693
class TestMergeRevisionRange(tests.TestCaseWithTransport):
 
694
 
 
695
    scenarios = (('whole-tree', dict(context='.')),
 
696
                 ('file-only', dict(context='a')))
 
697
 
 
698
    def setUp(self):
 
699
        super(TestMergeRevisionRange, self).setUp()
 
700
        self.tree = self.make_branch_and_tree(".")
 
701
        self.tree.commit('initial commit')
 
702
        for f in ("a", "b"):
 
703
            self.build_tree([f])
 
704
            self.tree.add(f)
 
705
            self.tree.commit("added " + f)
 
706
 
 
707
    def test_merge_reversed_revision_range(self):
 
708
        self.run_bzr("merge -r 2..1 " + self.context)
 
709
        self.assertPathDoesNotExist("a")
 
710
        self.assertPathExists("b")
 
711
 
 
712
 
698
713
class TestMergeScript(script.TestCaseWithTransportAndScript):
699
714
    def test_merge_empty_branch(self):
700
715
        source = self.make_branch_and_tree('source')