[PATCH 2 of 3] test-default-push: make `pwd` URL compatible on Windows

Matt Harbison matt_harbison at yahoo.com
Wed Dec 16 16:32:51 CST 2015


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1450304256 18000
#      Wed Dec 16 17:17:36 2015 -0500
# Node ID 7f132a6cf28e2b35d552d1c44afa42399b2116b9
# Parent  392e4dc34d8b8854cc79817492f4c5e53714752d
test-default-push: make `pwd` URL compatible on Windows

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.

diff --git a/tests/test-default-push.t b/tests/test-default-push.t
--- a/tests/test-default-push.t
+++ b/tests/test-default-push.t
@@ -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


More information about the Mercurial-devel mailing list