~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevisionnamespaces.py

Robey Pointers before: namespace to clear up usage of dates in revision parameters

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import os
 
18
import time
18
19
from bzrlib.selftest import TestCaseInTempDir
19
20
from bzrlib.errors import NoCommonAncestor, NoCommits
20
21
from bzrlib.branch import copy_branch
32
33
 
33
34
        b = Branch.initialize('.')
34
35
 
35
 
        b.commit('Commit one', rev_id='a@r-0-1')
 
36
        b.commit('Commit one', rev_id='a@r-0-1', timestamp=time.time() - 60*60*24)
36
37
        b.commit('Commit two', rev_id='a@r-0-2')
37
38
        b.commit('Commit three', rev_id='a@r-0-3')
38
39
 
46
47
                          RevisionSpec('revid:a@r-0-0').in_history, b)
47
48
        self.assertRaises(TypeError, RevisionSpec, object)
48
49
 
49
 
        self.assertEquals(RevisionSpec('date:-tomorrow').in_history(b),
50
 
                          (3, 'a@r-0-3'))
51
 
        self.assertEquals(RevisionSpec('date:+today').in_history(b),
 
50
        self.assertEquals(RevisionSpec('date:today').in_history(b),
 
51
                          (2, 'a@r-0-2'))
 
52
        self.assertEquals(RevisionSpec('date:yesterday').in_history(b),
 
53
                          (1, 'a@r-0-1'))
 
54
        self.assertEquals(RevisionSpec('before:date:today').in_history(b),
52
55
                          (1, 'a@r-0-1'))
53
56
 
54
57
        self.assertEquals(RevisionSpec('last:1').in_history(b),