compat/terminal: factor out echo-disabling
[alt-git.git] / t / t9020-remote-svn.sh
blob4f2dfe0e3d00010679c77e66c81b3ab4509e2522
1 #!/bin/sh
3 test_description='tests remote-svn'
5 . ./test-lib.sh
7 MARKSPATH=.git/info/fast-import/remote-svn
9 if ! test_have_prereq PYTHON
10 then
11 skip_all='skipping remote-svn tests, python not available'
12 test_done
15 # We override svnrdump by placing a symlink to the svnrdump-emulator in .
16 export PATH="$HOME:$PATH"
17 ln -sf $GIT_BUILD_DIR/contrib/svn-fe/svnrdump_sim.py "$HOME/svnrdump"
19 init_git () {
20 rm -fr .git &&
21 git init &&
22 #git remote add svnsim testsvn::sim:///$TEST_DIRECTORY/t9020/example.svnrdump
23 # let's reuse an exisiting dump file!?
24 git remote add svnsim testsvn::sim://$TEST_DIRECTORY/t9154/svn.dump
25 git remote add svnfile testsvn::file://$TEST_DIRECTORY/t9154/svn.dump
28 if test -e "$GIT_BUILD_DIR/git-remote-testsvn"
29 then
30 test_set_prereq REMOTE_SVN
33 test_debug '
34 git --version
35 which git
36 which svnrdump
39 test_expect_success REMOTE_SVN 'simple fetch' '
40 init_git &&
41 git fetch svnsim &&
42 test_cmp .git/refs/svn/svnsim/master .git/refs/remotes/svnsim/master &&
43 cp .git/refs/remotes/svnsim/master master.good
46 test_debug '
47 cat .git/refs/svn/svnsim/master
48 cat .git/refs/remotes/svnsim/master
51 test_expect_success REMOTE_SVN 'repeated fetch, nothing shall change' '
52 git fetch svnsim &&
53 test_cmp master.good .git/refs/remotes/svnsim/master
56 test_expect_success REMOTE_SVN 'fetch from a file:// url gives the same result' '
57 git fetch svnfile
60 test_expect_failure REMOTE_SVN 'the sha1 differ because the git-svn-id line in the commit msg contains the url' '
61 test_cmp .git/refs/remotes/svnfile/master .git/refs/remotes/svnsim/master
64 test_expect_success REMOTE_SVN 'mark-file regeneration' '
65 # filter out any other marks, that can not be regenerated. Only up to 3 digit revisions are allowed here
66 grep ":[0-9]\{1,3\} " $MARKSPATH/svnsim.marks > $MARKSPATH/svnsim.marks.old &&
67 rm $MARKSPATH/svnsim.marks &&
68 git fetch svnsim &&
69 test_cmp $MARKSPATH/svnsim.marks.old $MARKSPATH/svnsim.marks
72 test_expect_success REMOTE_SVN 'incremental imports must lead to the same head' '
73 export SVNRMAX=3 &&
74 init_git &&
75 git fetch svnsim &&
76 test_cmp .git/refs/svn/svnsim/master .git/refs/remotes/svnsim/master &&
77 unset SVNRMAX &&
78 git fetch svnsim &&
79 test_cmp master.good .git/refs/remotes/svnsim/master
82 test_debug 'git branch -a'
84 test_done