obslog: use singular name "succnode" for each element of {succnodes}
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 07 Nov 2019 13:21:20 -0800
changeset 4938 d8033f75a52e
parent 4929 bb2b4f6c99dc
child 4939 7aba58dc4b73
obslog: use singular name "succnode" for each element of {succnodes} The name that we pass for formatlist() is the name of each element. After this patch, you'll write '{succnodes % "{succnode}"}' instead of the confusing '{succnodes % "{succnodes}"}' (where the two "succnodes" refer to different things. Users can write templates that are compatible across this change by using e.g. '{succnodes % "{if(succnode, succnode, succnodes)}"}'.
hgext3rd/evolve/obshistory.py
--- a/hgext3rd/evolve/obshistory.py	Wed Nov 13 13:47:55 2019 +0700
+++ b/hgext3rd/evolve/obshistory.py	Thu Nov 07 13:21:20 2019 -0800
@@ -547,7 +547,7 @@
         fm.plain(b' as ')
 
         shortsnodes = (nodemod.short(succnode) for succnode in sorted(succnodes))
-        nodes = fm.formatlist(shortsnodes, b'succnodes', sep=b', ')
+        nodes = fm.formatlist(shortsnodes, b'succnode', sep=b', ')
         fm.write(b'succnodes', b'%s', nodes,
                  label=b"evolve.node")
 
@@ -675,7 +675,7 @@
         fm.plain(b' as ')
 
         shortsnodes = (nodemod.short(succnode) for succnode in sorted(succnodes))
-        nodes = fm.formatlist(shortsnodes, b'succnodes', sep=b', ')
+        nodes = fm.formatlist(shortsnodes, b'succnode', sep=b', ')
         fm.write(b'succnodes', b'%s', nodes,
                  label=b"evolve.node")