changeset 31688:c5fe0c7dad94

pager: do not read from environment variable $PAGER is converted to the pager.pager config item. So it's no longer necessary to read $PAGER in ui.pager().
author Jun Wu <quark@fb.com>
date Sun, 26 Mar 2017 21:43:47 -0700
parents 5bea95a1d353
children 57a22f699179
files mercurial/ui.py
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Sun Mar 26 21:41:42 2017 -0700
+++ b/mercurial/ui.py	Sun Mar 26 21:43:47 2017 -0700
@@ -849,14 +849,8 @@
             # HGPLAINEXCEPT=pager, and the user didn't specify --debug.
             return
 
-        # TODO: add a "system defaults" config section so this default
-        # of more(1) can be easily replaced with a global
-        # configuration file. For example, on OS X the sane default is
-        # less(1), not more(1), and on debian it's
-        # sensible-pager(1). We should probably also give the system
-        # default editor command similar treatment.
-        envpager = encoding.environ.get('PAGER', 'more')
-        pagercmd = self.config('pager', 'pager', envpager)
+        fallbackpager = 'more'
+        pagercmd = self.config('pager', 'pager', fallbackpager)
         if not pagercmd:
             return