test-command-template.t: make "age" filter test work on Feb 29th stable
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 02 Jan 2013 13:59:07 +0100
branchstable
changeset 18207 3b1005354440
parent 18205 cd64a8a2d0da
child 18224 0f9013112eba
test-command-template.t: make "age" filter test work on Feb 29th reported by Julien Cristau.
tests/test-command-template.t
--- a/tests/test-command-template.t	Wed Jan 02 00:07:43 2013 -0600
+++ b/tests/test-command-template.t	Wed Jan 02 13:59:07 2013 +0100
@@ -1346,10 +1346,10 @@
 
   $ hg log --template '{date|age}\n' > /dev/null || exit 1
 
-  >>> from datetime import datetime
+  >>> from datetime import datetime, timedelta
   >>> fp = open('a', 'w')
-  >>> n = datetime.now()
-  >>> fp.write('%d-%d-%d 00:00' % ((n.year + 7), n.month, n.day))
+  >>> n = datetime.now() + timedelta(366 * 7)
+  >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day))
   >>> fp.close()
   $ hg add a
   $ hg commit -m future -d "`cat a`"