~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-25 15:16:05 UTC
  • mfrom: (974.1.39)
  • mto: (1092.1.42) (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: abentley@panoramicfeedback.com-20050825151605-4798d422e71f1da4
Removed lookup_revision's requirement that revisions must be in history

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'))
43
45
 
 
46
        os.mkdir('newbranch')
 
47
        b2 = Branch('newbranch', init=True)
 
48
        self.assertEquals(b2.lookup_revision('revid:a@r-0-1'), 'a@r-0-1')
 
49
 
44
50
TEST_CLASSES = [
45
51
    TestRevisionNamespaces
46
52
    ]