~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevisionnamespaces.py

  • Committer: Aaron Bentley
  • Date: 2005-08-26 12:38:57 UTC
  • mfrom: (974.1.45)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: abentley@panoramicfeedback.com-20050826123857-06b8856e0fa2d374
Fixed ancestor-picking when -r is specified

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
class TestRevisionNamespaces(InTempDir):
21
21
    """Functional tests for hashcache"""
22
22
    def runTest(self):
23
 
        from bzrlib.errors import BzrError
 
23
        from bzrlib.errors import NoSuchRevision
24
24
        from bzrlib.branch import Branch
25
25
        import os
26
26
        import time
31
31
        b.commit('Commit two', rev_id='a@r-0-2')
32
32
        b.commit('Commit three', rev_id='a@r-0-3')
33
33
 
 
34
        self.assertEquals(b.get_revision_info(None), (0, None))
34
35
        self.assertEquals(b.get_revision_info(1), (1, 'a@r-0-1'))
35
36
        self.assertEquals(b.get_revision_info('revno:1'), (1, 'a@r-0-1'))
36
37
        self.assertEquals(b.get_revision_info('revid:a@r-0-1'), (1, 'a@r-0-1'))
37
 
        self.assertRaises(BzrError, b.get_revision_info, 'revid:a@r-0-0')
 
38
        self.assertRaises(NoSuchRevision, b.get_revision_info, 'revid:a@r-0-0')
 
39
        self.assertRaises(TypeError, b.get_revision_info, object)
38
40
 
39
41
        self.assertEquals(b.get_revision_info('date:-tomorrow'), (3, 'a@r-0-3'))
40
42
        self.assertEquals(b.get_revision_info('date:+today'), (1, 'a@r-0-1'))
41
43
 
42
44
        self.assertEquals(b.get_revision_info('last:1'), (3, 'a@r-0-3'))
 
45
        self.assertEquals(b.get_revision_info('-1'), (3, 'a@r-0-3'))
 
46
 
 
47
        os.mkdir('newbranch')
 
48
        b2 = Branch('newbranch', init=True)
 
49
        self.assertEquals(b2.lookup_revision('revid:a@r-0-1'), 'a@r-0-1')
43
50
 
44
51
TEST_CLASSES = [
45
52
    TestRevisionNamespaces