[PATCH 1 of 3 STABLE V2] tests: introduce "checkeditform-n-cat.sh" script to invoke "cat" in it safely

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Mon Oct 27 10:25:40 CDT 2014


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1414423158 -32400
#      Tue Oct 28 00:19:18 2014 +0900
# Branch stable
# Node ID 14cff7b55734a90f9c55a86f5522f1905f46c281
# Parent  0fc4686de1d762844c21f134bc6fdb010b7e6ec5
tests: introduce "checkeditform-n-cat.sh" script to invoke "cat" in it safely

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 newly introduces "checkeditform-n-cat.sh" script to invoke
"cat" in it 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,11 @@ clone so subsequent rollback isn't affec
   > env | grep HGEDITFORM
   > true
   > EOF
-  $ HGEDITOR="sh $TESTTMP/checkeditform.sh; cat" hg transplant --edit 7
+  $ cat > $TESTTMP/checkeditform-n-cat.sh <<EOF
+  > env | grep HGEDITFORM
+  > cat \$*
+  > EOF
+  $ HGEDITOR="sh $TESTTMP/checkeditform-n-cat.sh" hg transplant --edit 7
   applying ffd6818a3975
   HGEDITFORM=transplant.normal
   b3


More information about the Mercurial-devel mailing list