diff tests/test-command-template.t @ 25489:ef8956aa8755

templater: introduce indent function
author Ryan McElroy <rmcelroy@fb.com>
date Sat, 04 Apr 2015 01:03:52 -0700
parents 62da2d7745f9
children ad14fb602e5e
line wrap: on
line diff
--- a/tests/test-command-template.t	Sun Jun 07 17:14:17 2015 -0700
+++ b/tests/test-command-template.t	Sat Apr 04 01:03:52 2015 -0700
@@ -3252,3 +3252,21 @@
   $ hg log -Gv -R a --template "{word('a', desc)}"
   hg: parse error: word expects an integer index
   [255]
+
+Test indent and not adding to empty lines
+
+  $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a
+  -----
+   > line 1
+  >> line 2
+  -----
+   > other 1
+  >> other 2
+  
+  >> other 3
+
+Test with non-strings like dates
+
+  $ hg log -T "{indent(date, '   ')}\n" -r 2:3 -R a
+     1200000.00
+     1300000.00