diff tests/test-command-template.t @ 19770:0361163efbaf

templater: support using templates with non-standard names from map file Allow to add arbitrarily-named entries to a template map file and then reference them, to make it possible to deduplicate and simplify templates code.
author Alexander Plavin <alexander@plav.in>
date Sun, 22 Sep 2013 13:52:18 +0400
parents 867b9957d895
children c38c3fdc8b93 64b4f0cd7336
line wrap: on
line diff
--- a/tests/test-command-template.t	Fri Sep 06 13:30:56 2013 +0400
+++ b/tests/test-command-template.t	Sun Sep 22 13:52:18 2013 +0400
@@ -500,6 +500,28 @@
   1
   0
 
+Missing non-standard names give no error (backward compatibility):
+
+  $ echo "changeset = '{c}'" > t
+  $ hg log --style ./t
+
+Defining non-standard name works:
+
+  $ cat <<EOF > t
+  > changeset = '{c}'
+  > c = q
+  > EOF
+  $ hg log --style ./t
+  8
+  7
+  6
+  5
+  4
+  3
+  2
+  1
+  0
+
 ui.style works:
 
   $ echo '[ui]' > .hg/hgrc