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

Augie Fackler raf at durin42.com
Thu Jan 3 08:25:22 CST 2013


This LGTM (way better fix than mine!), but my ssh keys for pushing are at home, so I'll not push it just yet. If someone else can push it in the interim, feel encouraged to do so.

On Jan 2, 2013, at 8:00 AM, Benoit Boissinot <benoit.boissinot at ens-lyon.org> 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`"



More information about the Mercurial-devel mailing list