[PATCH] chg: exec pager in child process

Jun Wu quark at fb.com
Sat Jun 11 15:37:29 EDT 2016


Maybe I should just move the pager part to test-pager.t

But there is a chg pager test already, I think it might be okay to
merge this one and have a follow up to move these 2 to test-pager.t.

Excerpts from Jun Wu's message of 2016-06-11 20:27:07 +0100:
> diff --git a/tests/test-chg.t b/tests/test-chg.t
> --- a/tests/test-chg.t
> +++ b/tests/test-chg.t
> @@ -15,6 +15,9 @@
>    hg: parse error at * (glob)
>    [255]
>  
> +pager
> +-----
> +
>  alias having an environment variable and set to use pager
>  
>    $ rm $HGRCPATH
> @@ -35,6 +38,29 @@
>    $ A=2 chg printa
>    P2
>  
> +pager should not override the exit code of commands
> +
> +  $ cat >> $TESTTMP/fortytwo.py <<'EOF'
> +  > from mercurial import cmdutil, commands
> +  > cmdtable = {}
> +  > command = cmdutil.command(cmdtable)
> +  > @command('fortytwo', [], 'fortytwo', norepo=True)
> +  > def fortytwo(ui, *opts):
> +  >     ui.write('42\n')
> +  >     return 42
> +  > EOF
> +
> +  $ cat >> $HGRCPATH <<'EOF'
> +  > [extensions]
> +  > fortytwo = $TESTTMP/fortytwo.py
> +  > EOF
> +
> +  $ chg fortytwo --pager=on
> +  P42
> +  [42]
> +
> +restore hgrc
> +
>    $ cp $HGRCPATH.orig $HGRCPATH
>    $ cd ..
>  


More information about the Mercurial-devel mailing list