~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testmerge.py

  • Committer: Martin Pool
  • Date: 2005-09-16 03:32:44 UTC
  • mfrom: (1185.1.23)
  • mto: (1185.8.2) (974.1.91)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: mbp@sourcefrog.net-20050916033244-18c4f4bcba663e42
- merge in many integration fixes from Robert

  * xml escaping of unprintable characters

  * 'make clean'

  * new, more consistent Branch constructors 

  * RemoteBranch tests against local farmework

  * scott's non-verbose commit fix 

This seems to break this usage though 

  bzr diff -r 1207..1208 ../bzr.robertc-integration

robertc@robertcollins.net-20050915175953-a16fdc627ce7c541

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
from bzrlib.commit import commit
3
3
from bzrlib.selftest import TestCaseInTempDir
4
4
from bzrlib.merge import merge
 
5
from bzrlib.errors import UnrelatedBranches, NoCommits
 
6
import os
5
7
class TestMerge(TestCaseInTempDir):
6
8
    """Test appending more than one revision"""
7
9
    def test_pending(self):
8
 
        br = Branch(".", init=True)
 
10
        br = Branch.initialize(".")
9
11
        commit(br, "lala!")
10
12
        self.assertEquals(len(br.pending_merges()), 0)
11
13
        merge(['.', -1], [None, None])
12
14
        self.assertEquals(len(br.pending_merges()), 0)
 
15
 
 
16
    def test_nocommits(self):
 
17
        self.test_pending()
 
18
        os.mkdir('branch2')
 
19
        br2 = Branch.initialize('branch2')
 
20
        self.assertRaises(NoCommits, merge, ['branch2', -1], 
 
21
                          [None, None])
 
22
        return br2
 
23
 
 
24
    def test_unrelated(self):
 
25
        br2 = self.test_nocommits()
 
26
        commit(br2, "blah")
 
27
        merge, ['branch2', -1], [None, None]
 
28
        self.assertRaises(UnrelatedBranches, merge, ['branch2', -1], 
 
29
                          [None, None])
 
30