3 remotes_git_svn
=remotes
/git
""-svn
4 git_svn_id
=git
""-svn-id
6 if test -n "$NO_SVN_TESTS"
8 skip_all
='skipping git svn tests, NO_SVN_TESTS defined'
11 if ! test_have_prereq PERL
; then
12 skip_all
='skipping git svn tests, perl not available'
17 GIT_SVN_DIR
=$GIT_DIR/svn
/refs
/remotes
/git-svn
18 SVN_TREE
=$GIT_SVN_DIR/svn-tree
23 skip_all
='skipping git svn tests, svn not found'
35 \$SVN::Core::VERSION gt '1.1.0' or exit(42);
36 system(qw/svnadmin create --fs-type fsfs/, \$ENV{svnrepo}) == 0 or exit(41);
41 if test $x -eq 42; then
42 skip_all
='Perl SVN libraries must be >= 1.1.0'
43 elif test $x -eq 41; then
44 skip_all
='svnadmin failed to create fsfs repository'
46 skip_all
='Perl SVN libraries not found or unusable'
52 svnrepo
="file://$svnrepo"
58 # We need this, because we should pass empty configuration directory to
59 # the 'svn commit' to avoid automated property changes and other stuff
60 # that could be set from user's configuration files in ~/.subversion.
62 [ -d "$svnconf" ] || mkdir
"$svnconf"
63 orig_svncmd
="$1"; shift
64 if [ -z "$orig_svncmd" ]; then
68 svn
"$orig_svncmd" --config-dir "$svnconf" "$@"
71 maybe_start_httpd
() {
74 test_tristate GIT_SVN_TEST_HTTPD
75 case $GIT_SVN_TEST_HTTPD in
77 .
"$TEST_DIRECTORY"/lib-httpd.sh
89 convert_to_rev_db
() {
90 perl
-w -- - "$@" <<\EOF
92 @ARGV
== 2 or die
"usage: convert_to_rev_db <input> <output>";
93 open my
$wr, '+>', $ARGV[1] or die
"$!: couldn't open: $ARGV[1]";
94 open my
$rd, '<', $ARGV[0] or die
"$!: couldn't open: $ARGV[0]";
95 my
$size = (stat
($rd))[7];
96 ($size % 24) == 0 or die
"Inconsistent size: $size";
97 while (sysread
($rd, my
$buf, 24) == 24) {
98 my
($r, $c) = unpack
('NH40', $buf);
100 seek
$wr, 0, 2 or die $
!;
102 if ($pos < $offset) {
103 for (1 ..
(($offset - $pos) / 41)) {
104 print
$wr (('0' x
40),"\n") or die $
!;
107 seek
$wr, $offset, 0 or die $
!;
108 print
$wr $c,"\n" or die $
!;
115 require_svnserve
() {
116 if test -z "$SVNSERVE_PORT"
118 skip_all
='skipping svnserve test. (set $SVNSERVE_PORT to enable)'
124 svnserve
--listen-port $SVNSERVE_PORT \
125 --root "$rawsvnrepo" \
127 --listen-host 127.0.0.1 &
130 prepare_a_utf8_locale
() {
131 a_utf8_locale
=$
(locale
-a |
sed -n '/\.[uU][tT][fF]-*8$/{
135 if test -n "$a_utf8_locale"
139 say
"# UTF-8 locale not available, some tests are skipped"