[PATCH 2 of 8] tests: quote paths in shell script hooks

Matt Harbison mharbison72 at gmail.com
Sun Apr 2 19:12:48 EDT 2017


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1491074606 14400
#      Sat Apr 01 15:23:26 2017 -0400
# Node ID 54fd6d15228e8e2f8e735beac0db0930c60af9ad
# Parent  46f601b676cecfcc318f6852fe6ab6962703d2be
tests: quote paths in shell script hooks

Without the quoting, MSYS will remove the '\' directory separators, and the repo
can't be opened.

diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t
--- a/tests/test-bookmarks.t
+++ b/tests/test-bookmarks.t
@@ -924,9 +924,9 @@
 
   $ cat > $TESTTMP/checkpending.sh <<EOF
   > echo "@repo"
-  > hg -R $TESTTMP/repo bookmarks
+  > hg -R "$TESTTMP/repo" bookmarks
   > echo "@unrelated"
-  > hg -R $TESTTMP/unrelated bookmarks
+  > hg -R "$TESTTMP/unrelated" bookmarks
   > exit 1 # to avoid adding new bookmark for subsequent tests
   > EOF
 
diff --git a/tests/test-hook.t b/tests/test-hook.t
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -857,9 +857,9 @@
 
   $ cat > $TESTTMP/checkpending.sh <<EOF
   > echo '@a'
-  > hg -R $TESTTMP/a tip -q
+  > hg -R "$TESTTMP/a" tip -q
   > echo '@a/nested'
-  > hg -R $TESTTMP/a/nested tip -q
+  > hg -R "$TESTTMP/a/nested" tip -q
   > exit 1 # to avoid adding new revision for subsequent tests
   > EOF
   $ hg init nested
diff --git a/tests/test-phases.t b/tests/test-phases.t
--- a/tests/test-phases.t
+++ b/tests/test-phases.t
@@ -609,9 +609,9 @@
 
   $ cat > $TESTTMP/checkpending.sh <<EOF
   > echo '@initialrepo'
-  > hg -R $TESTTMP/initialrepo phase 7
+  > hg -R "$TESTTMP/initialrepo" phase 7
   > echo '@push-dest'
-  > hg -R $TESTTMP/push-dest phase 6
+  > hg -R "$TESTTMP/push-dest" phase 6
   > exit 1 # to avoid changing phase for subsequent tests
   > EOF
   $ cd ../initialrepo
diff --git a/tests/test-share.t b/tests/test-share.t
--- a/tests/test-share.t
+++ b/tests/test-share.t
@@ -168,11 +168,11 @@
 
   $ cat > $TESTTMP/checkbookmarks.sh <<EOF
   > echo "@repo1"
-  > hg -R $TESTTMP/repo1 bookmarks
+  > hg -R "$TESTTMP/repo1" bookmarks
   > echo "@repo2"
-  > hg -R $TESTTMP/repo2 bookmarks
+  > hg -R "$TESTTMP/repo2" bookmarks
   > echo "@repo3"
-  > hg -R $TESTTMP/repo3 bookmarks
+  > hg -R "$TESTTMP/repo3" bookmarks
   > exit 1 # to avoid adding new bookmark for subsequent tests
   > EOF
 


More information about the Mercurial-devel mailing list