Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them.
Page: /drakestapleton/git/blob/master/t/lib-git-svn.sh
# git
[Ported from github.com/git/git] Sync with Git 2.56.1
Brought by drakestapleton
Sign in to star 0 stars 0 watching
About Files History Releases Proposed changes Issues For developers
branch `master` Branches Tags History
`git / t / lib-git-svn.sh`
144 lines ยท 3213 bytes Raw Blame History
1 . ./test-lib.sh
2
3 if test -n "$NO_SVN_TESTS"
4 then
5 skip_all='skipping git svn tests, NO_SVN_TESTS defined'
6 test_done
7 fi
8 if ! test_have_prereq PERL; then
9 skip_all='skipping git svn tests, perl not available'
10 test_done
11 fi
12
13 GIT_DIR=$PWD/.git
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
17
18 if ! svn help >/dev/null 2>&1
19 then
20 skip_all='skipping git svn tests, svn not found'
21 test_done
22 fi
23
24 svnrepo=$PWD/svnrepo
25 export svnrepo
26 svnconf=$PWD/svnconf
27 export svnconf
28
29 x=0
30 perl -w -e "
31 use SVN::Core;
32 use SVN::Repos;
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);
35 " >&3 2>&4 || x=$?
36 if test $x -ne 0
37 then
38 if test $x -eq 42; then
39 skip_all='Perl SVN libraries must be >= 1.1.0'
40 elif test $x -eq 41; then
41 skip_all='svnadmin failed to create fsfs repository'
42 else
43 skip_all='Perl SVN libraries not found or unusable'
44 fi
45 test_done
46 fi
47
48 rawsvnrepo="$svnrepo"
49 svnrepo="file://$svnrepo"
50
51 poke() {
52 test-tool chmtime +1 "$1"
53 }
54
55 # We need this, because we should pass empty configuration directory to
56 # the 'svn commit' to avoid automated property changes and other stuff
57 # that could be set from user's configuration files in ~/.subversion.
58 svn_cmd () {
59 [ -d "$svnconf" ] || mkdir "$svnconf"
60 orig_svncmd="$1"; shift
61 if [ -z "$orig_svncmd" ]; then
62 svn
63 return
64 fi
65 svn "$orig_svncmd" --config-dir "$svnconf" "$@"
66 }
67
68 maybe_start_httpd () {
69 loc=${1-svn}
70
71 if test_bool_env GIT_TEST_SVN_HTTPD false
72 then
73 . "$TEST_DIRECTORY"/lib-httpd.sh
74 LIB_HTTPD_SVN="$loc"
75 start_httpd
76 fi
77 }
78
79 convert_to_rev_db () {
80 perl -w -- - "$(test_oid rawsz)" "$@" <<\EOF
81 use strict;
82 my $oidlen = shift;
83 @ARGV == 2 or die "usage: convert_to_rev_db