changeset 41330:d5c58d679ed9

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
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 23 Jan 2019 17:57:43 -0800
parents 84707d9e77a0
children 56a0de3d581c
files tests/test-mq-subrepo-svn.t
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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