templatekw: extract internal "{rev}:{node|formatnode}" template to constant
authorYuya Nishihara <yuya@tcha.org>
Fri, 26 Oct 2018 21:28:20 +0900
changeset 40474 2891ee3fcb86
parent 40471 844a40687d83
child 40475 8fa26f3baf30
templatekw: extract internal "{rev}:{node|formatnode}" template to constant This will be used later.
mercurial/templatekw.py
--- a/mercurial/templatekw.py	Thu Nov 01 14:35:18 2018 +0100
+++ b/mercurial/templatekw.py	Fri Oct 26 21:28:20 2018 +0900
@@ -153,10 +153,13 @@
     return dict(zip([s.split(':', 1)[0] for s in columns.splitlines()],
                     i18n._(columns).splitlines(True)))
 
+# basic internal templates
+_changeidtmpl = '{rev}:{node|formatnode}'
+
 # default templates internally used for rendering of lists
 defaulttempl = {
-    'parent': '{rev}:{node|formatnode} ',
-    'manifest': '{rev}:{node|formatnode}',
+    'parent': _changeidtmpl + ' ',
+    'manifest': _changeidtmpl,
     'file_copy': '{name} ({source})',
     'envvar': '{key}={value}',
     'extra': '{key}={value|stringescape}'