[PATCH STABLE] test-command-template.t: make "age" filter test work on Feb 29th

Pierre-Yves David pierre-yves.david at logilab.fr
Thu Jan 3 08:13:34 CST 2013


On Wed, Jan 02, 2013 at 02:00:24PM +0100, Benoit Boissinot wrote:
> # HG changeset patch
> # User Benoit Boissinot <benoit.boissinot at ens-lyon.org>
> # Date 1357131547 -3600
> # Branch stable
> # Node ID 3b1005354440baa448207057149d8ba8765fe082
> # Parent  cd64a8a2d0da5178de30105ff69ccff32a73a536
> test-command-template.t: make "age" filter test work on Feb 29th
> 
> reported by Julien Cristau.
> 
> diff --git a/tests/test-command-template.t b/tests/test-command-template.t
> --- a/tests/test-command-template.t
> +++ b/tests/test-command-template.t
> @@ -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`"

LGTM

-- 
Pierre-Yves David

http://www.logilab.fr/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130103/6bad960f/attachment.pgp>


More information about the Mercurial-devel mailing list