diff tests/test-convert-hg-svn @ 10775:c52057614c72 stable

Tests with spaces in paths This allows most tests to succeed with ./run-tests.py --tmpdir='/tmp/hg test' and introduces other tests for spaces and shell quoting
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 24 Mar 2010 01:43:24 +0100
parents a02d43acbc04
children
line wrap: on
line diff
--- a/tests/test-convert-hg-svn	Fri Mar 26 17:02:49 2010 +0100
+++ b/tests/test-convert-hg-svn	Wed Mar 24 01:43:24 2010 +0100
@@ -12,9 +12,9 @@
 echo "mq = " >> $HGRCPATH
 
 svnpath=`pwd | fix_path`/svn-repo
-svnadmin create $svnpath
+svnadmin create "$svnpath"
 
-cat > $svnpath/hooks/pre-revprop-change <<'EOF'
+cat > "$svnpath"/hooks/pre-revprop-change <<'EOF'
 #!/bin/sh
 
 REPOS="$1"
@@ -30,19 +30,19 @@
 echo "Changing prohibited revision property" >&2
 exit 1
 EOF
-chmod +x $svnpath/hooks/pre-revprop-change
+chmod +x "$svnpath"/hooks/pre-revprop-change
 
 # SVN wants all paths to start with a slash. Unfortunately,
 # Windows ones don't. Handle that.
-svnurl=$svnpath
-expr $svnurl : "\/" > /dev/null
+svnurl="$svnpath"
+expr "$svnurl" : "\/" > /dev/null
 if [ $? -ne 0 ]; then
-    svnurl='/'$svnurl
+    svnurl="/$svnurl"
 fi
-svnurl=file://$svnurl
-svn co $svnurl $svnpath-wc
+svnurl="file://$svnurl"
+svn co "$svnurl" "$svnpath"-wc
 
-cd $svnpath-wc
+cd "$svnpath"-wc
 echo a > a
 svn add a
 svn ci -m'added a' a
@@ -50,17 +50,17 @@
 cd ..
 
 echo % initial roundtrip
-hg convert -s svn -d hg $svnpath-wc $svnpath-hg | grep -v initializing
-hg convert -s hg -d svn $svnpath-hg $svnpath-wc
+hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg | grep -v initializing
+hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
 
 echo % second roundtrip should do nothing
-hg convert -s svn -d hg $svnpath-wc $svnpath-hg
-hg convert -s hg -d svn $svnpath-hg $svnpath-wc
+hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg
+hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
 
 echo % new hg rev
 
-hg clone $svnpath-hg $svnpath-work
-cd $svnpath-work
+hg clone "$svnpath"-hg "$svnpath"-work
+cd "$svnpath"-work
 echo b > b
 hg add b
 hg ci -mb
@@ -70,10 +70,10 @@
 cd ..
 
 echo % echo hg to svn
-hg --cwd $svnpath-hg pull -q $svnpath-work
-hg convert -s hg -d svn $svnpath-hg $svnpath-wc
+hg --cwd "$svnpath"-hg pull -q "$svnpath"-work
+hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
 
 echo % svn back to hg should do nothing
-hg convert -s svn -d hg $svnpath-wc $svnpath-hg
+hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg
 echo % hg back to svn should do nothing
-hg convert -s hg -d svn $svnpath-hg $svnpath-wc
+hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc