Patchwork [1,of,2,STABLE] test-bundle2-exchange: make hooks compatible with Windows

login
register
mail settings
Submitter Matt Harbison
Date April 26, 2015, 7:19 p.m.
Message ID <a56be8be80625bdef140.1430075970@Envy>
Download mbox | patch
Permalink /patch/8793/
State Accepted
Headers show

Comments

Matt Harbison - April 26, 2015, 7:19 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1430075409 14400
#      Sun Apr 26 15:10:09 2015 -0400
# Branch stable
# Node ID a56be8be80625bdef140c7cf4f0cce77ad5a9ec3
# Parent  8e43965a82153d2327e345d5694aa3465ed7057a
test-bundle2-exchange: make hooks compatible with Windows

The cmd.exe process doesn't fail the hook when "; false" is appended, and its
echo command prints out the quote characters.

Patch

diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-exchange.t
--- a/tests/test-bundle2-exchange.t
+++ b/tests/test-bundle2-exchange.t
@@ -557,8 +557,8 @@ 
   > [failpush]
   > reason =
   > [hooks]
-  > pretxnclose.failpush = echo "You shall not pass!"; false
-  > txnabort.failpush = echo 'Cleaning up the mess...'
+  > pretxnclose.failpush = sh -c "echo 'You shall not pass!'; false"
+  > txnabort.failpush = sh -c "echo 'Cleaning up the mess...'"
   > EOF
 
   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
@@ -622,7 +622,7 @@ 
 Check error from hook during the unbundling process itself
 
   $ cat << EOF >> $HGRCPATH
-  > pretxnchangegroup = echo "Fail early!"; false
+  > pretxnchangegroup = sh -c "echo 'Fail early!'; false"
   > EOF
   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
   $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log