changeset 18207:3b1005354440 stable

test-command-template.t: make "age" filter test work on Feb 29th reported by Julien Cristau.
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 02 Jan 2013 13:59:07 +0100
parents cd64a8a2d0da
children 0f9013112eba
files tests/test-command-template.t
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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`"