dispatch: consolidate pager flag handling to a single place
authorAugie Fackler <augie@google.com>
Sun, 19 Feb 2017 20:16:11 -0500
changeset 31027 04344226b3ce
parent 31026 9c827087df38
child 31028 3c22ad83868b
dispatch: consolidate pager flag handling to a single place This makes a little more sense, thanks to Martin for suggesting it.
mercurial/dispatch.py
--- 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: