tests: support URL quoting on Python 3
We could use mercurial.urllibcompat, but meh. This makes things
easier to read.
The test still fails on Python 3 for some reason. But at least
we no longer have an exception.
Differential Revision: https://phab.mercurial-scm.org/D5669
--- a/tests/test-mq-subrepo-svn.t Wed Jan 23 17:45:11 2019 -0800
+++ b/tests/test-mq-subrepo-svn.t Wed Jan 23 17:57:43 2019 -0800
@@ -23,10 +23,17 @@
$ svnadmin create svn-repo-2499
$ SVNREPOPATH=`pwd`/svn-repo-2499/project
+
+#if py3
+ $ pathquoted=`"$PYTHON" -c "import sys, urllib.parse; sys.stdout.write(urllib.parse.quote(sys.argv[1]))" "$SVNREPOPATH"`
+#else
+ $ pathquoted=`"$PYTHON" -c "import sys, urllib; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
+#endif
+
#if windows
- $ SVNREPOURL=file:///`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
+ $ SVNREPOURL=file:///$pathquoted
#else
- $ SVNREPOURL=file://`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
+ $ SVNREPOURL=file://$pathquoted
#endif
$ mkdir -p svn-project-2499/trunk