~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevisionnamespaces.py

merge from aaron - fixes bare excepts, adds ancestor namespace

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import os
18
18
from bzrlib.selftest import TestCaseInTempDir
 
19
from bzrlib.errors import NoCommonAncestor, NoCommits
 
20
from bzrlib.branch import copy_branch
 
21
from bzrlib.merge import merge
19
22
 
20
23
class TestRevisionNamespaces(TestCaseInTempDir):
21
24
    def test_revision_namespaces(self):
45
48
        os.mkdir('newbranch')
46
49
        b2 = Branch('newbranch', init=True)
47
50
        self.assertEquals(b2.lookup_revision('revid:a@r-0-1'), 'a@r-0-1')
 
51
 
 
52
        self.assertRaises(NoCommits, b2.lookup_revision, 'ancestor:.')
 
53
        self.assertEquals(b.lookup_revision('ancestor:.'), 'a@r-0-3')
 
54
        os.mkdir('copy')
 
55
        b3 = copy_branch(b, 'copy')
 
56
        b3.commit('Commit four', rev_id='b@r-0-4')
 
57
        self.assertEquals(b3.lookup_revision('ancestor:.'), 'a@r-0-3')
 
58
        merge(['copy', -1], [None, None])
 
59
        b.commit('Commit five', rev_id='a@r-0-4')
 
60
        self.assertEquals(b.lookup_revision('ancestor:copy'), 'b@r-0-4')
 
61
        self.assertEquals(b3.lookup_revision('ancestor:.'), 'b@r-0-4')