~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-12 09:49:37 UTC
  • mfrom: (2598.5.9 nullrevision)
  • Revision ID: pqm@pqm.ubuntu.com-20070712094937-rw5qbi81enh0pvhw
Make most functions prefer NULL_REVISION

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    option,
24
24
    )
25
25
from bzrlib.branch import Branch
26
 
from bzrlib.builtins import merge
 
26
from bzrlib.builtins import _merge_helper
27
27
from bzrlib.conflicts import ConflictList, TextConflict
28
28
from bzrlib.errors import UnrelatedBranches, NoCommits, BzrCommandError
29
29
from bzrlib.merge import transform_tree, merge_inner
41
41
        wt = self.make_branch_and_tree('.')
42
42
        rev_a = wt.commit("lala!")
43
43
        self.assertEqual([rev_a], wt.get_parent_ids())
44
 
        merge([u'.', -1], [None, None])
 
44
        _merge_helper([u'.', -1], [None, None])
45
45
        self.assertEqual([rev_a], wt.get_parent_ids())
46
46
 
47
47
    def test_undo(self):
49
49
        wt.commit("lala!")
50
50
        wt.commit("haha!")
51
51
        wt.commit("blabla!")
52
 
        merge([u'.', 2], [u'.', 1])
 
52
        _merge_helper([u'.', 2], [u'.', 1])
53
53
 
54
54
    def test_nocommits(self):
55
55
        self.test_pending()
56
56
        wt2 = self.make_branch_and_tree('branch2')
57
 
        self.assertRaises(NoCommits, merge, ['branch2', -1], 
 
57
        self.assertRaises(NoCommits, _merge_helper, ['branch2', -1],
58
58
                          [None, None])
59
59
        return wt2
60
60
 
61
61
    def test_unrelated(self):
62
62
        wt2 = self.test_nocommits()
63
63
        wt2.commit("blah")
64
 
        self.assertRaises(UnrelatedBranches, merge, ['branch2', -1], 
 
64
        self.assertRaises(UnrelatedBranches, _merge_helper, ['branch2', -1],
65
65
                          [None, None])
66
66
        return wt2
67
67
 
92
92
        br1.fetch(wt2.branch)
93
93
        # merge all of branch 2 into branch 1 even though they 
94
94
        # are not related.
95
 
        self.assertRaises(BzrCommandError, merge, ['branch2', -1],
 
95
        self.assertRaises(BzrCommandError, _merge_helper, ['branch2', -1],
96
96
                          ['branch2', 0], reprocess=True, show_base=True)
97
 
        merge(['branch2', -1], ['branch2', 0], reprocess=True)
 
97
        _merge_helper(['branch2', -1], ['branch2', 0], reprocess=True)
98
98
        self.assertEqual([br1.last_revision(), wt2.branch.last_revision()],
99
99
            wt1.get_parent_ids())
100
100
        return (wt1, wt2.branch)