29
30
b.commit('Commit two', rev_id='a@r-0-2')
30
31
b.commit('Commit three', rev_id='a@r-0-3')
32
self.assertEquals(b.get_revision_info(None), (0, None))
33
self.assertEquals(b.get_revision_info(1), (1, 'a@r-0-1'))
34
self.assertEquals(b.get_revision_info('revno:1'), (1, 'a@r-0-1'))
35
self.assertEquals(b.get_revision_info('revid:a@r-0-1'), (1, 'a@r-0-1'))
36
self.assertRaises(NoSuchRevision, b.get_revision_info, 'revid:a@r-0-0')
37
self.assertRaises(TypeError, b.get_revision_info, object)
39
self.assertEquals(b.get_revision_info('date:-tomorrow'), (3, 'a@r-0-3'))
40
self.assertEquals(b.get_revision_info('date:+today'), (1, 'a@r-0-1'))
42
self.assertEquals(b.get_revision_info('last:1'), (3, 'a@r-0-3'))
43
self.assertEquals(b.get_revision_info('-1'), (3, 'a@r-0-3'))
33
self.assertEquals(get_revision_info(b, None), (0, None))
34
self.assertEquals(get_revision_info(b, 1), (1, 'a@r-0-1'))
35
self.assertEquals(get_revision_info(b, 'revno:1'), (1, 'a@r-0-1'))
36
self.assertEquals(get_revision_info(b, 'revid:a@r-0-1'), (1, 'a@r-0-1'))
37
self.assertRaises(NoSuchRevision, get_revision_info, b, 'revid:a@r-0-0')
38
self.assertRaises(TypeError, get_revision_info, b, object)
40
self.assertEquals(get_revision_info(b, 'date:-tomorrow'), (3, 'a@r-0-3'))
41
self.assertEquals(get_revision_info(b, 'date:+today'), (1, 'a@r-0-1'))
43
self.assertEquals(get_revision_info(b, 'last:1'), (3, 'a@r-0-3'))
44
self.assertEquals(get_revision_info(b, '-1'), (3, 'a@r-0-3'))
45
46
os.mkdir('newbranch')
46
47
b2 = Branch('newbranch', init=True)
47
self.assertEquals(b2.lookup_revision('revid:a@r-0-1'), 'a@r-0-1')
48
self.assertEquals(b2.lookup_revision('revid:a@r-0-1'), None)