changeset 31047:04344226b3ce

dispatch: consolidate pager flag handling to a single place This makes a little more sense, thanks to Martin for suggesting it.
author Augie Fackler <augie@google.com>
date Sun, 19 Feb 2017 20:16:11 -0500
parents 9c827087df38
children 3c22ad83868b
files mercurial/dispatch.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Sun Feb 19 20:12:52 2017 -0500
+++ b/mercurial/dispatch.py	Sun Feb 19 20:16:11 2017 -0500
@@ -749,7 +749,9 @@
             for ui_ in uis:
                 ui_.setconfig('ui', 'interactive', 'off', '-y')
 
-        if options['pager'] != 'auto' and not util.parsebool(options['pager']):
+        if util.parsebool(options['pager']):
+            ui.pager('internal-always-' + cmd)
+        elif options['pager'] != 'auto':
             ui.disablepager()
 
         if cmdoptions.get('insecure', False):
@@ -822,8 +824,6 @@
 
 def _runcommand(ui, options, cmd, cmdfunc):
     """Run a command function, possibly with profiling enabled."""
-    if util.parsebool(options['pager']):
-        ui.pager('internal-always-' + cmd)
     try:
         return cmdfunc()
     except error.SignatureError: