Patchwork [STABLE] tests: use double quote to quote arguments in hook for portability

login
register
mail settings
Submitter Katsunori FUJIWARA
Date April 23, 2015, 1:41 p.m.
Message ID <f256ddec4b2cb02c3384.1429796474@juju>
Download mbox | patch
Permalink /patch/8769/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - April 23, 2015, 1:41 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1429796361 -32400
#      Thu Apr 23 22:39:21 2015 +0900
# Branch stable
# Node ID f256ddec4b2cb02c3384b634bcfbb2358ce07efe
# Parent  1f9127c9239b9c39c676bb09752db1e2ca6c26f7
tests: use double quote to quote arguments in hook for portability

On windows, single quote doesn't work as quote character in hook
command line, because "cmd.exe" doesn't recognize it as quoting
character. And this causes failure of test.

This patch uses double quote to quote arguments in hook instead of
single quote for portability.

Even though single quotes for "[hooks] pretxncommit" in
test-clone-pull-corruption.t seems to work correctly (may MinGW sh
treat specially ?) AFAIK, this patch also replaces them by double
quotes for consistency.
Matt Mackall - April 23, 2015, 5:36 p.m.
On Thu, 2015-04-23 at 22:41 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1429796361 -32400
> #      Thu Apr 23 22:39:21 2015 +0900
> # Branch stable
> # Node ID f256ddec4b2cb02c3384b634bcfbb2358ce07efe
> # Parent  1f9127c9239b9c39c676bb09752db1e2ca6c26f7
> tests: use double quote to quote arguments in hook for portability

Queued for stable, thanks.

Patch

diff --git a/tests/test-clone-pull-corruption.t b/tests/test-clone-pull-corruption.t
--- a/tests/test-clone-pull-corruption.t
+++ b/tests/test-clone-pull-corruption.t
@@ -16,7 +16,7 @@  Add a hook to wait 5 seconds and then ab
 
   $ cd ../corrupted
   $ echo "[hooks]" >> .hg/hgrc
-  $ echo "pretxncommit = sh -c 'sleep 5; exit 1'" >> .hg/hgrc
+  $ echo 'pretxncommit = sh -c "sleep 5; exit 1"' >> .hg/hgrc
 
 start a commit...
 
diff --git a/tests/test-pending.t b/tests/test-pending.t
--- a/tests/test-pending.t
+++ b/tests/test-pending.t
@@ -120,7 +120,7 @@  Test that pending on transaction without
   $ cat <<EOF > parent/.hg/hgrc
   > [hooks]
   > pretxnchangegroup=
-  > pretxnclose = hg tip -T 'tip: {node|short}\n'
+  > pretxnclose = hg tip -T "tip: {node|short}\n"
   > [phases]
   > publishing=False
   > EOF