changeset_templater: simplify handling of verbosity postfix
authorYuya Nishihara <yuya@tcha.org>
Sat, 22 Apr 2017 21:06:11 +0900
changeset 32964 74fa8753990b
parent 32963 0ce2cbebd749
child 32965 3f07f12c6e10
changeset_templater: simplify handling of verbosity postfix
mercurial/cmdutil.py
--- 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