pager: rename 'pager.enable' to 'ui.paginate'

This aligns with what we do for color (see cea7a760c58d). 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.
This commit is contained in:
Pierre-Yves David 2017-05-01 16:36:50 +02:00
parent f6556e7dce
commit bf9fa9e05b
4 changed files with 13 additions and 13 deletions

View File

@ -1367,9 +1367,6 @@ Supported arguments:
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 @@ User interface controls.
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

View File

@ -29,7 +29,7 @@ you can use --pager=<value>:
To globally turn off all attempts to use a pager, set::
[pager]
enable = false
[ui]
paginate = never
which will prevent the pager from running.

View File

@ -55,10 +55,9 @@ username =
# (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 @@ default = %s
# (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 @@ class ui(object):
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.

View File

@ -54,21 +54,21 @@ By default diff and log are paged, but id is not:
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'