3 if test -n "$NO_SVN_TESTS"
 
   5         skip_all='skipping git svn tests, NO_SVN_TESTS defined'
 
   8 if ! test_have_prereq PERL; then
 
   9         skip_all='skipping git svn tests, perl not available'
 
  14 GIT_SVN_DIR=$GIT_DIR/svn/refs/remotes/git-svn
 
  15 SVN_TREE=$GIT_SVN_DIR/svn-tree
 
  16 test_set_port SVNSERVE_PORT
 
  21         skip_all='skipping git svn tests, svn not found'
 
  33 \$SVN::Core::VERSION gt '1.1.0' or exit(42);
 
  34 system(qw/svnadmin create --fs-type fsfs/, \$ENV{svnrepo}) == 0 or exit(41);
 
  39         if test $x -eq 42; then
 
  40                 skip_all='Perl SVN libraries must be >= 1.1.0'
 
  41         elif test $x -eq 41; then
 
  42                 skip_all='svnadmin failed to create fsfs repository'
 
  44                 skip_all='Perl SVN libraries not found or unusable'
 
  50 svnrepo="file://$svnrepo"
 
  53         test-tool chmtime +1 "$1"
 
  56 # We need this, because we should pass empty configuration directory to
 
  57 # the 'svn commit' to avoid automated property changes and other stuff
 
  58 # that could be set from user's configuration files in ~/.subversion.
 
  60         [ -d "$svnconf" ] || mkdir "$svnconf"
 
  61         orig_svncmd="$1"; shift
 
  62         if [ -z "$orig_svncmd" ]; then
 
  66         svn "$orig_svncmd" --config-dir "$svnconf" "$@"
 
  69 maybe_start_httpd () {
 
  72         if test_bool_env GIT_TEST_SVN_HTTPD false
 
  74                 . "$TEST_DIRECTORY"/lib-httpd.sh
 
  80 convert_to_rev_db () {
 
  81         perl -w -- - "$@" <<\EOF
 
  83 @ARGV == 2 or die "usage: convert_to_rev_db <input> <output>";
 
  84 open my $wr, '+>', $ARGV[1] or die "$!: couldn't open: $ARGV[1]";
 
  85 open my $rd, '<', $ARGV[0] or die "$!: couldn't open: $ARGV[0]";
 
  86 my $size = (stat($rd))[7];
 
  87 ($size % 24) == 0 or die "Inconsistent size: $size";
 
  88 while (sysread($rd, my $buf, 24) == 24) {
 
  89         my ($r, $c) = unpack('NH40', $buf);
 
  91         seek $wr, 0, 2 or die $!;
 
  94                 for (1 .. (($offset - $pos) / 41)) {
 
  95                         print $wr (('0' x 40),"\n") or die $!;
 
  98         seek $wr, $offset, 0 or die $!;
 
  99         print $wr $c,"\n" or die $!;
 
 106 require_svnserve () {
 
 107         if ! test_bool_env GIT_TEST_SVNSERVE false
 
 109                 skip_all='skipping svnserve test. (set $GIT_TEST_SVNSERVE to enable)'
 
 115         svnserve --listen-port $SVNSERVE_PORT \
 
 116                  --root "$rawsvnrepo" \
 
 118                  --listen-host 127.0.0.1 &
 
 121 prepare_a_utf8_locale () {
 
 122         a_utf8_locale=$(locale -a | sed -n '/\.[uU][tT][fF]-*8$/{
 
 126         if test -n "$a_utf8_locale"
 
 130                 say "# UTF-8 locale not available, some tests are skipped"