[PATCH 10 of 10 V4] pager: do not read from environment variable

Jun Wu quark at fb.com
Mon Mar 27 00:49:23 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1490589827 25200
#      Sun Mar 26 21:43:47 2017 -0700
# Node ID 4a8d065bbad80d3b3401010375bc80165404aa87
# Parent  cc06430c144b85ae2d53528eb8149f1debdb7706
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 4a8d065bbad8
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().

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -850,12 +850,6 @@ class ui(object):
             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


More information about the Mercurial-devel mailing list