Mercurial > hg
diff tests/test-command-template.t @ 38285:8d6109b49b31
templater: introduce a wrapper for date tuple (BC)
Strictly speaking, this is BC, but I believe the original string format
(str(float(unixtime)) + str(int(tzoffset))) was just plain wrong.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 24 Mar 2018 17:54:02 +0900 |
parents | aaed058a0390 |
children | 851fc9d42d6d |
line wrap: on
line diff
--- a/tests/test-command-template.t Sat Apr 21 19:01:35 2018 +0900 +++ b/tests/test-command-template.t Sat Mar 24 17:54:02 2018 +0900 @@ -1548,33 +1548,33 @@ branches--debug: branches--debug: branches--debug: - date: 1577872860.00 - date: 1000000.00 - date: 1500001.00 - date: 1500000.00 - date: 1400000.00 - date: 1300000.00 - date: 1200000.00 - date: 1100000.00 - date: 1000000.00 - date--verbose: 1577872860.00 - date--verbose: 1000000.00 - date--verbose: 1500001.00 - date--verbose: 1500000.00 - date--verbose: 1400000.00 - date--verbose: 1300000.00 - date--verbose: 1200000.00 - date--verbose: 1100000.00 - date--verbose: 1000000.00 - date--debug: 1577872860.00 - date--debug: 1000000.00 - date--debug: 1500001.00 - date--debug: 1500000.00 - date--debug: 1400000.00 - date--debug: 1300000.00 - date--debug: 1200000.00 - date--debug: 1100000.00 - date--debug: 1000000.00 + date: 1577872860 0 + date: 1000000 0 + date: 1500001 0 + date: 1500000 0 + date: 1400000 0 + date: 1300000 0 + date: 1200000 0 + date: 1100000 0 + date: 1000000 0 + date--verbose: 1577872860 0 + date--verbose: 1000000 0 + date--verbose: 1500001 0 + date--verbose: 1500000 0 + date--verbose: 1400000 0 + date--verbose: 1300000 0 + date--verbose: 1200000 0 + date--verbose: 1100000 0 + date--verbose: 1000000 0 + date--debug: 1577872860 0 + date--debug: 1000000 0 + date--debug: 1500001 0 + date--debug: 1500000 0 + date--debug: 1400000 0 + date--debug: 1300000 0 + date--debug: 1200000 0 + date--debug: 1100000 0 + date--debug: 1000000 0 desc: third desc: second desc: merge @@ -2291,7 +2291,7 @@ $ hg log -r0 --template '{author|lower}\n' user name <user@hostname> $ hg log -r0 --template '{date|upper}\n' - 1000000.00 + 1000000 0 Add a commit that does all possible modifications at once @@ -2806,9 +2806,9 @@ Behind the scenes, this would throw TypeError without intype=bytes $ hg log -l 3 --template '{date|obfuscate}\n' - 0.00 - 0.00 - 1577872860.00 + 0 0 + 0 0 + 1577872860 0 Behind the scenes, this will throw a ValueError @@ -2820,9 +2820,9 @@ Behind the scenes, this would throw AttributeError without intype=bytes $ hg log -l 3 --template 'line: {date|escape}\n' - line: 0.00 - line: 0.00 - line: 1577872860.00 + line: 0 0 + line: 0 0 + line: 1577872860 0 $ hg log -l 3 --template 'line: {extras|localdate}\n' hg: parse error: localdate expects a date information @@ -3293,6 +3293,15 @@ (max first argument should be an iterable) [255] + $ hg log -R latesttag -l1 -T '{min(date)}' + hg: parse error: date is not iterable + (min first argument should be an iterable) + [255] + $ hg log -R latesttag -l1 -T '{max(date)}' + hg: parse error: date is not iterable + (max first argument should be an iterable) + [255] + Test min/max of empty sequence: $ hg debugtemplate '{min("")}' @@ -3902,12 +3911,14 @@ (get() expects a dict as first argument) [255] -Test json filter applied to hybrid object: +Test json filter applied to wrapped object: $ hg log -r0 -T '{files|json}\n' ["a"] $ hg log -r0 -T '{extras|json}\n' {"branch": "default"} + $ hg log -r0 -T '{date|json}\n' + [0, 0] Test json filter applied to map result: @@ -4608,8 +4619,8 @@ Test with non-strings like dates $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a - 1200000.00 - 1300000.00 + 1200000 0 + 1300000 0 Test broken string escapes: