~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevisionnamespaces.py

  • Committer: Lalo Martins
  • Date: 2005-09-09 18:59:17 UTC
  • mto: (1185.1.22)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: lalo@exoweb.net-20050913094215-c9b1ceb71213cf51
polishing up the RevisionSpec api, as per suggestions from Robert

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
        b.commit('Commit two', rev_id='a@r-0-2')
31
31
        b.commit('Commit three', rev_id='a@r-0-3')
32
32
 
33
 
        self.assertEquals(RevisionSpec(b, None), (0, None))
34
 
        self.assertEquals(RevisionSpec(b, 1), (1, 'a@r-0-1'))
35
 
        self.assertEquals(RevisionSpec(b, 'revno:1'), (1, 'a@r-0-1'))
36
 
        self.assertEquals(RevisionSpec(b, 'revid:a@r-0-1'), (1, 'a@r-0-1'))
37
 
        self.assertRaises(NoSuchRevision, RevisionSpec, b, 'revid:a@r-0-0')
38
 
        self.assertRaises(TypeError, RevisionSpec, b, object)
39
 
 
40
 
        self.assertEquals(RevisionSpec(b, 'date:-tomorrow'), (3, 'a@r-0-3'))
41
 
        self.assertEquals(RevisionSpec(b, 'date:+today'), (1, 'a@r-0-1'))
42
 
 
43
 
        self.assertEquals(RevisionSpec(b, 'last:1'), (3, 'a@r-0-3'))
44
 
        self.assertEquals(RevisionSpec(b, '-1'), (3, 'a@r-0-3'))
 
33
        self.assertEquals(RevisionSpec(None).in_history(b), (0, None))
 
34
        self.assertEquals(RevisionSpec(1).in_history(b), (1, 'a@r-0-1'))
 
35
        self.assertEquals(RevisionSpec('revno:1').in_history(b),
 
36
                          (1, 'a@r-0-1'))
 
37
        self.assertEquals(RevisionSpec('revid:a@r-0-1').in_history(b),
 
38
                          (1, 'a@r-0-1'))
 
39
        self.assertRaises(NoSuchRevision,
 
40
                          RevisionSpec('revid:a@r-0-0').in_history, b)
 
41
        self.assertRaises(TypeError, RevisionSpec, object)
 
42
 
 
43
        self.assertEquals(RevisionSpec('date:-tomorrow').in_history(b),
 
44
                          (3, 'a@r-0-3'))
 
45
        self.assertEquals(RevisionSpec('date:+today').in_history(b),
 
46
                          (1, 'a@r-0-1'))
 
47
 
 
48
        self.assertEquals(RevisionSpec('last:1').in_history(b),
 
49
                          (3, 'a@r-0-3'))
 
50
        self.assertEquals(RevisionSpec('-1').in_history(b), (3, 'a@r-0-3'))