2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
|
|
|
#chg-compatible
|
|
|
|
|
2018-03-29 18:06:30 +03:00
|
|
|
#testcases withpytz withoutpytz
|
|
|
|
#if withpytz
|
2019-11-11 21:11:00 +03:00
|
|
|
$ hg debugshell -c "import pytz; pytz.__name__" || exit 80
|
2018-03-29 18:06:30 +03:00
|
|
|
#endif
|
2020-01-20 13:42:49 +03:00
|
|
|
$ enable smartlog
|
2018-03-29 18:06:30 +03:00
|
|
|
$ TZ=UTC
|
|
|
|
$ export TZ
|
|
|
|
|
|
|
|
Create a repo with some commits at interesting dates.
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
2018-05-23 18:57:39 +03:00
|
|
|
$ for d in 1970-01-01T00:00 1996-02-29T15:00 1996-03-01T19:20 1996-03-06T08:00 1996-03-07T12:02 1996-03-07T13:56 1996-03-07T14:00 1996-03-07T23:59
|
2018-03-29 18:06:30 +03:00
|
|
|
> do
|
|
|
|
> echo "$d" > stamp
|
|
|
|
> hg commit -Aqm "$d" -d "$d"
|
|
|
|
> done
|
|
|
|
|
|
|
|
Test smartlog with smartdate.
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg smartlog -r 'all()' -T '{smartdate(date, 5400, age(date), simpledate(date))} "{desc}"' --config extensions.fakedate=$TESTDIR/fakedate.py
|
|
|
|
@ 1996-03-07 23:59 "1996-03-07T23:59"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 1 second ago "1996-03-07T14:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 4 minutes ago "1996-03-07T13:56"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Today at 12:02 "1996-03-07T12:02"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Yesterday at 08:00 "1996-03-06T08:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Friday at 19:20 "1996-03-01T19:20"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Feb 29 at 15:00 "1996-02-29T15:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 1970-01-01 00:00 "1970-01-01T00:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg smartlog -r 'all()' -T '{smartdate(date, 18000, age(date), simpledate(date))} "{desc}"' --config extensions.fakedate=$TESTDIR/fakedate.py
|
|
|
|
@ 1996-03-07 23:59 "1996-03-07T23:59"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 1 second ago "1996-03-07T14:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 4 minutes ago "1996-03-07T13:56"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 118 minutes ago "1996-03-07T12:02"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Yesterday at 08:00 "1996-03-06T08:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Friday at 19:20 "1996-03-01T19:20"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Feb 29 at 15:00 "1996-02-29T15:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 1970-01-01 00:00 "1970-01-01T00:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
$ TZ=America/Los_Angeles hg smartlog -r 'all()' -T '{smartdate(date, 5400, age(date), simpledate(date))} "{desc}"' --config extensions.fakedate=$TESTDIR/fakedate.py
|
|
|
|
@ 1996-03-07 15:59 "1996-03-07T23:59"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 1 second ago "1996-03-07T14:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 4 minutes ago "1996-03-07T13:56"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Today at 04:02 "1996-03-07T12:02"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Yesterday at 00:00 "1996-03-06T08:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Friday at 11:20 "1996-03-01T19:20"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Feb 29 at 07:00 "1996-02-29T15:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 1969-12-31 16:00 "1970-01-01T00:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
|
|
#if withpytz
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg smartlog -r 'all()' -T '{smartdate(date, 5400, age(date), simpledate(date, "Australia/Sydney"))} "{desc}"' --config extensions.fakedate=$TESTDIR/fakedate.py
|
|
|
|
@ 1996-03-08 10:59 "1996-03-07T23:59"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 1 second ago "1996-03-07T14:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 4 minutes ago "1996-03-07T13:56"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Yesterday at 23:02 "1996-03-07T12:02"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Wednesday at 19:00 "1996-03-06T08:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Saturday at 06:20 "1996-03-01T19:20"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o Mar 01 at 02:00 "1996-02-29T15:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o 1970-01-01 10:00 "1970-01-01T00:00"
|
2018-03-29 18:06:30 +03:00
|
|
|
|
|
|
|
#endif
|