Patchwork [1,of,2,pager-tweaks] ui: rename neverpager to disablepager

login
register
mail settings
Submitter Augie Fackler
Date Feb. 20, 2017, 1:19 a.m.
Message ID <147cbbe59b257eac92c7.1487553581@imladris.local>
Download mbox | patch
Permalink /patch/18678/
State Accepted
Headers show

Comments

Augie Fackler - Feb. 20, 2017, 1:19 a.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1487553172 18000
#      Sun Feb 19 20:12:52 2017 -0500
# Node ID 147cbbe59b257eac92c779361894ae361a788f83
# Parent  2c9e619ba9ee8e72370cc0f27f59da39947773b6
ui: rename neverpager to disablepager

I agree this is a clearer name for this method.

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -750,7 +750,7 @@  def _dispatch(req):
                 ui_.setconfig('ui', 'interactive', 'off', '-y')
 
         if options['pager'] != 'auto' and not util.parsebool(options['pager']):
-            ui.neverpager()
+            ui.disablepager()
 
         if cmdoptions.get('insecure', False):
             for ui_ in uis:
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -160,7 +160,7 @@  class ui(object):
             self.ferr = src.ferr
             self.fin = src.fin
             self.pageractive = src.pageractive
-            self._neverpager = src._neverpager
+            self._disablepager = src._disablepager
 
             self._tcfg = src._tcfg.copy()
             self._ucfg = src._ucfg.copy()
@@ -179,7 +179,7 @@  class ui(object):
             self.ferr = util.stderr
             self.fin = util.stdin
             self.pageractive = False
-            self._neverpager = False
+            self._disablepager = False
 
             # shared read-only environment
             self.environ = encoding.environ
@@ -838,8 +838,8 @@  class ui(object):
             return False
         return util.isatty(fh)
 
-    def neverpager(self):
-        self._neverpager = True
+    def disablepager(self):
+        self._disablepager = True
 
     def pager(self, command):
         """Start a pager for subsequent command output.
@@ -854,7 +854,7 @@  class ui(object):
           command: The full, non-aliased name of the command. That is, "log"
                    not "history, "summary" not "summ", etc.
         """
-        if (self._neverpager
+        if (self._disablepager
             or self.pageractive
             or command in self.configlist('pager', 'ignore')
             or not self.configbool('pager', 'attend-' + command, True)