changeset 32946:74fa8753990b

changeset_templater: simplify handling of verbosity postfix
author Yuya Nishihara <yuya@tcha.org>
date Sat, 22 Apr 2017 21:06:11 +0900
parents 0ce2cbebd749
children 3f07f12c6e10
files mercurial/cmdutil.py
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue Jun 20 16:33:46 2017 -0400
+++ b/mercurial/cmdutil.py	Sat Apr 22 21:06:11 2017 +0900
@@ -1586,10 +1586,10 @@
 
         # find correct templates for current mode
         tmplmodes = [
-            (True, None),
-            (self.ui.verbose, 'verbose'),
-            (self.ui.quiet, 'quiet'),
-            (self.ui.debugflag, 'debug'),
+            (True, ''),
+            (self.ui.verbose, '_verbose'),
+            (self.ui.quiet, '_quiet'),
+            (self.ui.debugflag, '_debug'),
         ]
 
         self._tref = tmplspec.ref
@@ -1598,9 +1598,7 @@
                        'docheader': '', 'docfooter': ''}
         for mode, postfix in tmplmodes:
             for t in self._parts:
-                cur = t
-                if postfix:
-                    cur += "_" + postfix
+                cur = t + postfix
                 if mode and cur in self.t:
                     self._parts[t] = cur