changeset 10198:c2168d170f05

test-subrepo-svn: normalize OS specific path separator
author Patrick Mezard <pmezard@gmail.com>
date Sat, 02 Jan 2010 16:03:29 +0100
parents 29e3c4a7699b
children c2e2a5e6c36b
files tests/test-subrepo-svn
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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