changeset 40474:2891ee3fcb86

templatekw: extract internal "{rev}:{node|formatnode}" template to constant This will be used later.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 26 Oct 2018 21:28:20 +0900
parents 844a40687d83
children 8fa26f3baf30
files mercurial/templatekw.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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}'