~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevisionnamespaces.py

  • Committer: Aaron Bentley
  • Date: 2005-09-14 16:37:24 UTC
  • mto: (1185.1.16)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: abentley@panoramicfeedback.com-20050914163724-24852cc764d1bcf4
Added ancestor revision namepsace

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')