~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testmerge.py

  • Committer: Aaron Bentley
  • Date: 2005-09-18 21:47:53 UTC
  • mto: (1185.1.29)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: aaron.bentley@utoronto.ca-20050918214753-129f45a74b8af9f2
Fixed merging with multiple roots, by using null as graph root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
from bzrlib.selftest import TestCaseInTempDir
4
4
from bzrlib.merge import merge
5
5
from bzrlib.errors import UnrelatedBranches, NoCommits
 
6
from bzrlib.revision import common_ancestor
6
7
import os
7
8
class TestMerge(TestCaseInTempDir):
8
9
    """Test appending more than one revision"""
35
36
        merge(['branch2', -1], ['branch2', 0])
36
37
        self.assertEquals(len(br1.pending_merges()), 1)
37
38
        return (br1, br2)
 
39
 
 
40
    def test_two_roots(self):
 
41
        """Merge base is sane when two unrelated branches are merged"""
 
42
        br1, br2 = self.test_pending_with_null()
 
43
        commit(br1, "blah")
 
44
        last = br1.last_patch()
 
45
        self.assertEquals(common_ancestor(last, last, br1), last)