pager: rename 'pager.enable' to 'ui.paginate' stable
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 01 May 2017 16:36:50 +0200
branchstable
changeset 32104 f06d23af6cdf
parent 32103 9a98023ac8db
child 32105 2384a6546927
pager: rename 'pager.enable' to 'ui.paginate' This aligns with what we do for color (see 7fec37746417). Pager is a central enough notion that having the master config in the [ui] section makes senses. It will helps with consistency, discoverability. It will also help having a simple and clear example hgrc mentioning pager. The previous form of the option had never been released in a non-rc version but we keep it around for convenience. If both are set, 'ui.pager' take priority.
mercurial/help/config.txt
mercurial/help/pager.txt
mercurial/ui.py
tests/test-pager.t
--- a/mercurial/help/config.txt	Tue May 02 20:19:09 2017 +0200
+++ b/mercurial/help/config.txt	Mon May 01 16:36:50 2017 +0200
@@ -1367,9 +1367,6 @@
 Setting used to control when to paginate and with what external tool. See
 :hg:`help pager` for details.
 
-``enable``
-  Control the pagination of command output (default: True).
-
 ``pager``
     Define the external tool used as pager.
 
@@ -1963,6 +1960,10 @@
     The path to a directory used to store generated .orig files. If the path is
     not a directory, one will be created.
 
+``paginate``
+  Control the pagination of command output (default: True). See :hg:`help pager`
+  for details.
+
 ``patch``
     An optional external tool that ``hg import`` and some extensions
     will use for applying patches. By default Mercurial uses an
--- a/mercurial/help/pager.txt	Tue May 02 20:19:09 2017 +0200
+++ b/mercurial/help/pager.txt	Mon May 01 16:36:50 2017 +0200
@@ -29,7 +29,7 @@
 
 To globally turn off all attempts to use a pager, set::
 
-  [pager]
-  enable = false
+  [ui]
+  paginate = never
 
 which will prevent the pager from running.
--- a/mercurial/ui.py	Tue May 02 20:19:09 2017 +0200
+++ b/mercurial/ui.py	Mon May 01 16:36:50 2017 +0200
@@ -55,10 +55,9 @@
 # (see 'hg help color' for details)
 # color = never
 
-[pager]
 # uncomment to disable command output pagination
 # (see 'hg help pager' for details)
-# enable = never
+# paginate = never
 
 [extensions]
 # uncomment these lines to enable some popular extensions
@@ -108,10 +107,9 @@
 # (see 'hg help color' for details)
 # color = never
 
-[pager]
 # uncomment to disable command output pagination
 # (see 'hg help pager' for details)
-# enable = never
+# paginate = never
 
 [extensions]
 # uncomment these lines to enable some popular extensions
@@ -858,7 +856,8 @@
         if (self._disablepager
             or self.pageractive
             or command in self.configlist('pager', 'ignore')
-            or not self.configbool('pager', 'enable', True)
+            or not self.configbool('ui', 'paginate',
+                                   self.configbool('pager', 'enable', True))
             or not self.configbool('pager', 'attend-' + command, True)
             # TODO: if we want to allow HGPLAINEXCEPT=pager,
             # formatted() will need some adjustment.
--- a/tests/test-pager.t	Tue May 02 20:19:09 2017 +0200
+++ b/tests/test-pager.t	Mon May 01 16:36:50 2017 +0200
@@ -54,21 +54,21 @@
 
 We can control the pager from the config
 
-  $ hg log --limit 1 --config 'pager.enable=False'
+  $ hg log --limit 1 --config 'ui.paginate=False'
   changeset:   10:46106edeeb38
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     modify a 10
   
-  $ hg log --limit 1 --config 'pager.enable=0'
+  $ hg log --limit 1 --config 'ui.paginate=0'
   changeset:   10:46106edeeb38
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     modify a 10
   
-  $ hg log --limit 1 --config 'pager.enable=1'
+  $ hg log --limit 1 --config 'ui.paginate=1'
   paged! 'changeset:   10:46106edeeb38\n'
   paged! 'tag:         tip\n'
   paged! 'user:        test\n'