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

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Oct. 27, 2014, 3:25 p.m.
Message ID <14cff7b55734a90f9c55.1414423540@juju>
Download mbox | patch
Permalink /patch/6471/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - Oct. 27, 2014, 3:25 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@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.
Mads Kiilerich - Oct. 27, 2014, 3:40 p.m.
This series LGTM - assuming it actually has been tested on Windows (and 
if not, we will find out and it can be fixed later).

/Mads

Patch

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