changeset 33729: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
+++ b/mercurial/cmdutil.py
@@ -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