# HG changeset patch # User Gregory Szorc # Date 2019-01-24 01:57:43 # Node ID d5c58d679ed96e684ca8602a90a40f8238b19a68 # Parent 84707d9e77a027b76952ee6952b9833093df8000 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 diff --git a/tests/test-mq-subrepo-svn.t b/tests/test-mq-subrepo-svn.t --- a/tests/test-mq-subrepo-svn.t +++ b/tests/test-mq-subrepo-svn.t @@ -23,10 +23,17 @@ handle svn subrepos safely $ 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