diff tests/test-identify.t @ 37075:46859b437697

templater: drop symbols which should be overridden by new 'ctx' (issue5612) This problem is caused by impedance mismatch between the templater and the formatter interface, which is that the template keywords are generally evaluated dynamically, but the formatter puts static values into a template mapping. This patch avoids the problem by removing conflicting values from a mapping dict when a 'ctx' is switched.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 15 Mar 2018 21:38:57 +0900
parents 73dfc72704b6
children 8bb3899a0f47
line wrap: on
line diff
--- a/tests/test-identify.t	Thu Mar 15 21:22:52 2018 +0900
+++ b/tests/test-identify.t	Thu Mar 15 21:38:57 2018 +0900
@@ -63,6 +63,16 @@
   $ hg id -T '{parents % "{rev} {node|shortest} {desc}\n"}'
   0 cb9a a
 
+test nested template: '{tags}'/'{node}' constants shouldn't override the
+default keywords, but '{id}' persists because there's no default keyword
+for '{id}' (issue5612)
+
+  $ hg id -T '{tags}\n'
+  tip
+  $ hg id -T '{revset("null:.") % "{rev}:{node|short} {tags} {id}\n"}'
+  -1:000000000000  cb9a9f314b8b
+  0:cb9a9f314b8b tip cb9a9f314b8b
+
 with modifications
 
   $ echo b > a