~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testmerge.py

  • Committer: Robert Collins
  • Date: 2005-09-23 09:25:16 UTC
  • mto: (1092.3.4)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: robertc@robertcollins.net-20050923092516-e2c3c0f31288669d
Merge what applied of Alexander Belchenko's win32 patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import os
2
 
 
3
1
from bzrlib.branch import Branch
4
2
from bzrlib.commit import commit
5
3
from bzrlib.selftest import TestCaseInTempDir
6
4
from bzrlib.merge import merge
7
5
from bzrlib.errors import UnrelatedBranches, NoCommits
8
6
from bzrlib.revision import common_ancestor
9
 
from bzrlib.fetch import fetch
10
 
 
11
 
 
 
7
import os
12
8
class TestMerge(TestCaseInTempDir):
13
9
    """Test appending more than one revision"""
14
10
    def test_pending(self):
37
33
        """When base is forced to revno 0, pending_merges is set"""
38
34
        br2 = self.test_unrelated()
39
35
        br1 = Branch.open('.')
40
 
        fetch(from_branch=br2, to_branch=br1)
41
 
        # merge all of branch 2 into branch 1 even though they 
42
 
        # are not related.
43
36
        merge(['branch2', -1], ['branch2', 0])
44
37
        self.assertEquals(len(br1.pending_merges()), 1)
45
38
        return (br1, br2)
48
41
        """Merge base is sane when two unrelated branches are merged"""
49
42
        br1, br2 = self.test_pending_with_null()
50
43
        commit(br1, "blah")
51
 
        last = br1.last_revision()
 
44
        last = br1.last_patch()
52
45
        self.assertEquals(common_ancestor(last, last, br1), last)