[PATCH 3 of 5] pager: skip uisetup if chg is detected

Sean Farley sean at farley.io
Mon Mar 14 16:37:52 EDT 2016


Jun Wu <quark at fb.com> writes:

> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1457967799 0
> #      Mon Mar 14 15:03:19 2016 +0000
> # Node ID d931d9d34b74ae2d4ed16737c98bfe6b56ec79e5
> # Parent  e14741b16063879d0d4d67a4ad5f0129b8f4f769
> pager: skip uisetup if chg is detected
>
> chg has its own pager implementation that it wants to skip pager's uisetup.
> It is currently done by redirecting stdout to /dev/null, which has unintended
> side effects. This patch makes pager aware of chg and skip uisetup directly
> from pager. We may want to merge chg and pager's pager implementation to
> make this unnecessary in the future.
>
> diff --git a/hgext/pager.py b/hgext/pager.py
> --- a/hgext/pager.py
> +++ b/hgext/pager.py
> @@ -117,6 +117,10 @@
>      if '--debugger' in sys.argv or not ui.formatted():
>          return
>  
> +    # chg has its own pager implementation
> +    if 'chgunix' in dispatch._earlygetopt('--cmdserver', sys.argv):
> +        return
> +

Would this be reason enough to put pager in core so we wouldn't need
different implementations?


More information about the Mercurial-devel mailing list