test-subrepo-svn: normalize OS specific path separator
authorPatrick Mezard <pmezard@gmail.com>
Sat, 02 Jan 2010 16:03:29 +0100
changeset 10198 c2168d170f05
parent 10197 29e3c4a7699b
child 10199 c2e2a5e6c36b
test-subrepo-svn: normalize OS specific path separator
tests/test-subrepo-svn
--- a/tests/test-subrepo-svn	Sat Jan 02 16:03:25 2010 +0100
+++ b/tests/test-subrepo-svn	Sat Jan 02 16:03:29 2010 +0100
@@ -2,11 +2,19 @@
 
 "$TESTDIR/hghave" svn || exit 80
 
-escapedwd=$(pwd | \
-            python -c \
-            "import sys,urllib; print urllib.pathname2url(sys.stdin.read().strip())"
-           )
-filterpath="sed s+$escapedwd+/root+"
+fix_path()
+{
+    tr '\\' /
+}
+
+escapedwd=`pwd | fix_path`
+# SVN wants all paths to start with a slash. Unfortunately,
+# Windows ones don't. Handle that.
+expr $escapedwd : "\/" > /dev/null
+if [ $? -ne 0 ]; then
+    escapedwd='/'$escapedwd
+fi
+filterpath="sed s|$escapedwd|/root|"
 
 echo % create subversion repo
 
@@ -64,7 +72,7 @@
 echo
 echo % clone
 cd ..
-hg clone t tc
+hg clone t tc | fix_path
 cd tc
 echo % debugsub in clone
 hg debugsub | $filterpath