diff mercurial/commands.py @ 39626:6ecfd12f09cd

identify: change {parents} to a list of nodes (BC) This is a part of the name unification. {parents} is a list of nodes in "hg log -Tjson" output. Since {rev} can be computed from (repo, node) pair, we no longer need to put it to provide {rev} to user templates. https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Dictionary
author Yuya Nishihara <yuya@tcha.org>
date Sat, 01 Sep 2018 12:15:02 +0900
parents 10c5eacd793f
children ee7ee0c516ca
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Sep 01 12:09:22 2018 +0900
+++ b/mercurial/commands.py	Sat Sep 01 12:15:02 2018 +0900
@@ -3058,13 +3058,8 @@
                 numoutput = ["%d" % p.rev() for p in parents]
                 output.append("%s%s" % ('+'.join(numoutput), dirty))
 
-            fn = fm.nested('parents', tmpl='{rev}:{node|formatnode}', sep=' ')
-            for p in parents:
-                fn.startitem()
-                fn.data(rev=p.rev())
-                fn.data(node=p.hex())
-                fn.context(ctx=p)
-            fn.end()
+            fm.data(parents=fm.formatlist([fm.hexfunc(p.node())
+                                           for p in parents], name='node'))
         else:
             hexoutput = fm.hexfunc(ctx.node())
             if default or id: