Code

Merge branch 'fl/git-pm'
[git.git] / t / lib-git-svn.sh
index de384e6ac3a125e59156abbf897a3371f736bbfa..56549623430ca6bea2de35bbae7d2d211720da3b 100644 (file)
@@ -7,7 +7,10 @@ if test -n "$NO_SVN_TESTS"
 then
        say 'skipping git svn tests, NO_SVN_TESTS defined'
        test_done
-       exit
+fi
+if ! test_have_prereq PERL; then
+       say 'skipping git svn tests, perl not available'
+       test_done
 fi
 
 GIT_DIR=$PWD/.git
@@ -19,11 +22,12 @@ if test $? -ne 1
 then
     say 'skipping git svn tests, svn not found'
     test_done
-    exit
 fi
 
 svnrepo=$PWD/svnrepo
 export svnrepo
+svnconf=$PWD/svnconf
+export svnconf
 
 perl -w -e "
 use SVN::Core;
@@ -43,7 +47,6 @@ then
        fi
        say "$err"
        test_done
-       exit
 fi
 
 rawsvnrepo="$svnrepo"
@@ -53,6 +56,19 @@ poke() {
        test-chmtime +1 "$1"
 }
 
+# We need this, because we should pass empty configuration directory to
+# the 'svn commit' to avoid automated property changes and other stuff
+# that could be set from user's configuration files in ~/.subversion.
+svn_cmd () {
+       [ -d "$svnconf" ] || mkdir "$svnconf"
+       orig_svncmd="$1"; shift
+       if [ -z "$orig_svncmd" ]; then
+               svn
+               return
+       fi
+       svn "$orig_svncmd" --config-dir "$svnconf" "$@"
+}
+
 for d in \
        "$SVN_HTTPD_PATH" \
        /usr/sbin/apache2 \
@@ -144,7 +160,6 @@ require_svnserve () {
     then
         say 'skipping svnserve test. (set $SVNSERVE_PORT to enable)'
         test_done
-        exit
     fi
 }