]> git.ipfire.org Git - thirdparty/git.git/blame - t/lib-git-svn.sh
Add test-chmtime: a utility to change mtime on files
[thirdparty/git.git] / t / lib-git-svn.sh
CommitLineData
60d02ccc
EW
1. ./test-lib.sh
2
3if test -n "$NO_SVN_TESTS"
36f5b1f0 4then
60d02ccc
EW
5 test_expect_success 'skipping git-svn tests, NO_SVN_TESTS defined' :
6 test_done
7 exit
36f5b1f0
EW
8fi
9
b9c85187
EW
10GIT_DIR=$PWD/.git
11GIT_SVN_DIR=$GIT_DIR/svn/git-svn
12SVN_TREE=$GIT_SVN_DIR/svn-tree
13
36f5b1f0 14svn >/dev/null 2>&1
4b832e81 15if test $? -ne 1
36f5b1f0 16then
60d02ccc 17 test_expect_success 'skipping git-svn tests, svn not found' :
36f5b1f0
EW
18 test_done
19 exit
20fi
21
22svnrepo=$PWD/svnrepo
23
c6d499a8
EW
24perl -w -e "
25use SVN::Core;
26use SVN::Repos;
27\$SVN::Core::VERSION gt '1.1.0' or exit(42);
e66191f4 28system(qw/svnadmin create --fs-type fsfs/, '$svnrepo') == 0 or exit(41);
38434f2e 29" >&3 2>&4
c6d499a8
EW
30x=$?
31if test $x -ne 0
dc62e25c 32then
c6d499a8
EW
33 if test $x -eq 42; then
34 err='Perl SVN libraries must be >= 1.1.0'
e66191f4
EW
35 elif test $x -eq 41; then
36 err='svnadmin failed to create fsfs repository'
c6d499a8
EW
37 else
38 err='Perl SVN libraries not found or unusable, skipping test'
39 fi
40 test_expect_success "$err" :
41 test_done
42 exit
dc62e25c
EW
43fi
44
2edb9c5c 45rawsvnrepo="$svnrepo"
e1516119 46svnrepo="file://$svnrepo"
36f5b1f0 47
7b3fab87
MS
48poke() {
49 perl -e '@x = stat($ARGV[0]); utime($x[8], $x[9] + 1, $ARGV[0])' "$1"
50}