tests: make `pwd` URL compatible on Windows in test-default-push
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 16 Dec 2015 17:17:36 -0500
changeset 27437 52ae742c8035
parent 27436 912255f8f087
child 27438 f121cf57ca9a
tests: make `pwd` URL compatible on Windows in test-default-push Without this, the test fails with: $ hg -q commit -A -m 'add pushurl' abort: file:// URLs can only refer to localhost $ hg push abort: file:// URLs can only refer to localhost The variable $PWD causes check-code to complain, so avoid that.
tests/test-default-push.t
--- a/tests/test-default-push.t	Wed Dec 16 13:33:43 2015 -0500
+++ b/tests/test-default-push.t	Wed Dec 16 17:17:36 2015 -0500
@@ -75,10 +75,16 @@
   $ hg -q clone a pushurlsource
   $ hg -q clone a pushurldest
   $ cd pushurlsource
+
+Windows needs a leading slash to make a URL that passes all of the checks
+  $ WD=`pwd`
+#if windows
+  $ WD="/$WD"
+#endif
   $ cat > .hg/hgrc << EOF
   > [paths]
   > default = https://example.com/not/relevant
-  > default:pushurl = file://`pwd`/../pushurldest
+  > default:pushurl = file://$WD/../pushurldest
   > EOF
 
   $ touch pushurl