Patchwork [1,of,8] changeset_templater: simplify handling of verbosity postfix

login
register
mail settings
Submitter Yuya Nishihara
Date June 20, 2017, 3:57 p.m.
Message ID <504f31ba18b5336a0c46.1497974243@mimosa>
Download mbox | patch
Permalink /patch/21533/
State Accepted
Headers show

Comments

Yuya Nishihara - June 20, 2017, 3:57 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1492862771 -32400
#      Sat Apr 22 21:06:11 2017 +0900
# Node ID 504f31ba18b5336a0c463462be8e382f26a9b8ec
# Parent  b08431e1b0627e5d0e75de75266223b46d70dd2f
changeset_templater: simplify handling of verbosity postfix

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1586,10 +1586,10 @@  class changeset_templater(changeset_prin
 
         # 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 @@  class changeset_templater(changeset_prin
                        '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