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

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Mon Oct 20 08:26:59 CDT 2014


# 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
   applying ffd6818a3975
   HGEDITFORM=transplant.normal
   b3


More information about the Mercurial-devel mailing list