--- a/tests/test-template-map.t Sat Oct 05 23:20:35 2019 -0400
+++ b/tests/test-template-map.t Sat Oct 05 23:30:09 2019 -0400
@@ -736,6 +736,18 @@
}
]
+ $ hg log -r . -T'cbor(rev, node|short)' | "$PYTHON" "$TESTTMP/decodecborarray.py"
+ [
+ {
+ 'node': '95c24699272e',
+ 'rev': 8
+ }
+ ]
+
+ $ hg log -r . -T'cbor()' | "$PYTHON" "$TESTTMP/decodecborarray.py"
+ [
+ {}
+ ]
Test JSON style:
@@ -1101,6 +1113,17 @@
}
]
+ $ hg log -l2 -T'json(rev, parents)'
+ [
+ {"parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"], "rev": 8},
+ {"parents": ["0000000000000000000000000000000000000000"], "rev": 7}
+ ]
+
+ $ hg log -r. -T'json()'
+ [
+ {}
+ ]
+
Other unsupported formatter styles:
$ hg log -qr . -Tpickle
@@ -1110,6 +1133,24 @@
abort: "debug" not in template map
[255]
+Unparsable function-style references:
+
+ $ hg log -qr . -T'json(-)'
+ hg: parse error at 6: not a prefix: )
+ (json(-)
+ ^ here)
+ [255]
+
+For backward compatibility, the following examples are not parsed as
+function-style references:
+
+ $ hg log -qr . -T'cbor(rev'
+ cbor(rev (no-eol)
+ $ hg log -qr . -T'json (rev)'
+ json (rev) (no-eol)
+ $ hg log -qr . -T'json(x="{rev}")'
+ json(x="8") (no-eol)
+
Error if style not readable:
#if unix-permissions no-root