Merge branch 'jn/svn-fe' (early part) into next
[git/mingw/4msysgit.git] / t / t9010-svn-fe.sh
blobc96bf2f5c04774f04f2f87c72edcaae7bbaa72e1
1 #!/bin/sh
3 test_description='check svn dumpfile importer'
5 . ./test-lib.sh
7 if ! svnadmin -h >/dev/null 2>&1
8 then
9 skip_all='skipping svn-fe tests, svn not available'
10 test_done
13 svnconf=$PWD/svnconf
14 export svnconf
16 svn_cmd () {
17 subcommand=$1 &&
18 shift &&
19 mkdir -p "$svnconf" &&
20 svn "$subcommand" --config-dir "$svnconf" "$@"
23 reinit_git () {
24 rm -fr .git &&
25 git init
28 >empty
30 test_expect_success 'empty dump' '
31 reinit_git &&
32 echo "SVN-fs-dump-format-version: 2" >input &&
33 test-svn-fe input >stream &&
34 git fast-import <stream
37 test_expect_success 'v3 dumps not supported' '
38 reinit_git &&
39 echo "SVN-fs-dump-format-version: 3" >input &&
40 test_must_fail test-svn-fe input >stream &&
41 test_cmp empty stream
44 test_expect_success 't9135/svn.dump' '
45 svnadmin create simple-svn &&
46 svnadmin load simple-svn <"$TEST_DIRECTORY/t9135/svn.dump" &&
47 svn_cmd export "file://$PWD/simple-svn" simple-svnco &&
48 git init simple-git &&
49 test-svn-fe "$TEST_DIRECTORY/t9135/svn.dump" >simple.fe &&
51 cd simple-git &&
52 git fast-import <../simple.fe
53 ) &&
55 cd simple-svnco &&
56 git init &&
57 git add . &&
58 git fetch ../simple-git master &&
59 git diff --exit-code FETCH_HEAD
63 test_done