[PATCH 1 of 4] templatekw: extract internal "{rev}:{node|formatnode}" template to constant

Yuya Nishihara yuya at tcha.org
Fri Nov 2 13:18:36 UTC 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1540556900 -32400
#      Fri Oct 26 21:28:20 2018 +0900
# Node ID 276558285cd47fc388aed7861eaf7237c6d184e3
# Parent  c2a0bc6412dbbcbba20517e250b0fcd2fc79b0e7
templatekw: extract internal "{rev}:{node|formatnode}" template to constant

This will be used later.

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -153,10 +153,13 @@ def getlogcolumns():
     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}'


More information about the Mercurial-devel mailing list