[PATCH 05 of 11 STABLE] tests: use "sh -c 'script'" style to invoke commands safely anywhere

Mads Kiilerich mads at kiilerich.com
Mon Oct 20 08:58:39 CDT 2014


On 10/20/2014 03:26 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 da9791c9eb40fc5f2fdb89b97b487e80dcd1a04d
> # Parent  ae05e90779d6a2a6d094f05933ba8a8c34f4c517
> tests: use "sh -c 'script'" style to invoke commands safely anywhere
>
> Before this patch, a part of "test-transplant.t" fails unexpectedly on
> Windows environment, because semicolon (";") in HGEDITOR isn't
> recognized as the command separator by "cmd.exe".
>
> This patch uses "sh -c 'script'" style to invoke multiple commands
> (script "checkeditform.sh" and "cat" command) in HGEDITOR safely
> anywhere.
>
> diff --git a/tests/test-transplant.t b/tests/test-transplant.t
> --- a/tests/test-transplant.t
> +++ b/tests/test-transplant.t
> @@ -99,7 +99,7 @@ clone so subsequent rollback isn't affec
>     > env | grep HGEDITFORM
>     > true
>     > EOF
> -  $ HGEDITOR="sh $TESTTMP/checkeditform.sh; cat" hg transplant --edit 7
> +  $ HGEDITOR="sh -c 'sh \$TESTTMP/checkeditform.sh; cat \$0'" hg transplant --edit 7

Could we just include the cat in checkeditform.sh for this test?

/Mads


More information about the Mercurial-devel mailing list