[PATCH 3 of 4 STABLE V3] pager: rename 'pager.enable' to 'ui.pager'

Augie Fackler raf at durin42.com
Tue May 2 12:50:51 EDT 2017


On Tue, May 02, 2017 at 05:35:43PM +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1493649410 -7200
> #      Mon May 01 16:36:50 2017 +0200
> # Branch stable
> # Node ID 6658075e3b3b3cbbeff2beb1e9cef5c478d9a592
> # Parent  8308b782037b7026adec025886829c6f8cbd6c16
> # EXP-Topic pager
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 6658075e3b3b
> pager: rename 'pager.enable' to 'ui.pager'

Can you please do a v4 after you've fixed all references to ui.pager?

Thanks!

>
> 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.
>
> diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
> --- a/mercurial/help/config.txt
> +++ b/mercurial/help/config.txt
> @@ -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
> diff --git a/mercurial/help/pager.txt b/mercurial/help/pager.txt
> --- a/mercurial/help/pager.txt
> +++ b/mercurial/help/pager.txt
> @@ -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.
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -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.
> diff --git a/tests/test-pager.t b/tests/test-pager.t
> --- a/tests/test-pager.t
> +++ b/tests/test-pager.t
> @@ -54,21 +54,21 @@ By default diff and log are paged, but i
>
>  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'
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list