[PATCH 06 of 11 STABLE] tests: use "sh -c 'script'" style to evaluate "$HG_ARGS" correctly anywhere

Mads Kiilerich mads at kiilerich.com
Mon Oct 20 09:04:47 CDT 2014


On 10/20/2014 03:27 PM, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1413810488 -32400
> #      Mon Oct 20 22:08:08 2014 +0900
> # Branch stable
> # Node ID e5555e390871e982270f94cd62bfd771faa97f0b
> # Parent  da9791c9eb40fc5f2fdb89b97b487e80dcd1a04d
> tests: use "sh -c 'script'" style to evaluate "$HG_ARGS" correctly anywhere
>
> Before this patch, a part of "test-alias.t" fails unexpectedly on
> Windows environment, because "cmd.exe" can't evaluate "$HG_ARGS"
> expression in shell alias.
>
> This patch uses "sh -c 'script'" style to evaluate "$HG_ARGS"
> expression correctly anywhere.
>
> diff --git a/tests/test-alias.t b/tests/test-alias.t
> --- a/tests/test-alias.t
> +++ b/tests/test-alias.t
> @@ -395,7 +395,7 @@ command provided extension, should be ab
>     > [extensions]
>     > hgext.rebase =
>     > [alias]
> -  > rebate = !echo this is \$HG_ARGS
> +  > rebate = !bash -c 'echo this is \$HG_ARGS'

We do (unfortunately) not depend on bash.

It would perhaps be more "correct" to test that native shell syntax 
works and use %HG_ARGS% when on windows.

I guess this also means that the help for config.alias is incorrect. It 
is not ' "$HG" expands to ' but more like ' the HG environment variable 
is set to '.

/Mads



More information about the Mercurial-devel mailing list