# HG changeset patch # User Yuya Nishihara # Date 1492862771 -32400 # Node ID 74fa8753990b0c79a3e08505ff07fbd774120a7a # Parent 0ce2cbebd74964ffe61e79de8941461bccc9371b changeset_templater: simplify handling of verbosity postfix diff -r 0ce2cbebd749 -r 74fa8753990b 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