diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-01-13 11:36:05 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-01-13 11:36:05 -0800 |
commit | 857ba709df3de6805063128d98c2e3b19d7fc11a (patch) | |
tree | 1de462de4d60746d161da2e503a99836c18c92ad /t | |
parent | 7810c6b6d6cf91d624216623e2327d7cb63c1c92 (diff) | |
parent | 3aa30471065b212ee6563f3bfcb2de92a2bf2fa9 (diff) | |
download | git-857ba709df3de6805063128d98c2e3b19d7fc11a.tar.gz |
Merge branch 'rj/svn-test'
* rj/svn-test:
lib-git-svn.sh: Move web-server handling code into separate function
Diffstat (limited to 't')
-rw-r--r-- | t/lib-git-svn.sh | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh index 6a9d975723..199f22c231 100644 --- a/t/lib-git-svn.sh +++ b/t/lib-git-svn.sh @@ -68,8 +68,7 @@ svn_cmd () { svn "$orig_svncmd" --config-dir "$svnconf" "$@" } -if test -n "$SVN_HTTPD_PORT" -then +prepare_httpd () { for d in \ "$SVN_HTTPD_PATH" \ /usr/sbin/apache2 \ @@ -83,8 +82,8 @@ then done if test -z "$SVN_HTTPD_PATH" then - skip_all='skipping git svn tests, Apache not found' - test_done + echo >&2 '*** error: Apache not found' + return 1 fi for d in \ "$SVN_HTTPD_MODULE_PATH" \ @@ -99,23 +98,16 @@ then done if test -z "$SVN_HTTPD_MODULE_PATH" then - skip_all='skipping git svn tests, Apache module dir not found' - test_done - fi -fi - -start_httpd () { - repo_base_path="$1" - if test -z "$SVN_HTTPD_PORT" - then - echo >&2 'SVN_HTTPD_PORT is not defined!' - return + echo >&2 '*** error: Apache module dir not found' + return 1 fi - if test -z "$repo_base_path" + if test ! -f "$SVN_HTTPD_MODULE_PATH/mod_dav_svn.so" then - repo_base_path=svn + echo >&2 '*** error: Apache module "mod_dav_svn" not found' + return 1 fi + repo_base_path="${1-svn}" mkdir "$GIT_DIR"/logs cat > "$GIT_DIR/httpd.conf" <<EOF @@ -132,12 +124,24 @@ LoadModule dav_svn_module $SVN_HTTPD_MODULE_PATH/mod_dav_svn.so SVNPath "$rawsvnrepo" </Location> EOF +} + +start_httpd () { + if test -z "$SVN_HTTPD_PORT" + then + echo >&2 'SVN_HTTPD_PORT is not defined!' + return + fi + + prepare_httpd "$1" || return 1 + "$SVN_HTTPD_PATH" -f "$GIT_DIR"/httpd.conf -k start svnrepo="http://127.0.0.1:$SVN_HTTPD_PORT/$repo_base_path" } stop_httpd () { test -z "$SVN_HTTPD_PORT" && return + test ! -f "$GIT_DIR/httpd.conf" && return "$SVN_HTTPD_PATH" -f "$GIT_DIR"/httpd.conf -k stop } |