3 test_description
='git cvsimport basic tests'
6 if ! test_have_prereq PERL
; then
7 say
'skipping git cvsimport tests, perl not available'
11 CVSROOT
=$
(pwd)/cvsroot
14 # for clean cvsps cache
18 if ! type cvs
>/dev
/null
2>&1
20 say
'skipping cvsimport tests, cvs not found'
24 cvsps_version
=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
25 case "$cvsps_version" in
29 say
'skipping cvsimport tests, cvsps not found'
33 say
'skipping cvsimport tests, unsupported cvsps version'
38 test_expect_success
'setup cvsroot' 'cvs init'
40 test_expect_success
'setup a cvs module' '
42 mkdir "$CVSROOT/module" &&
43 cvs co -d module-cvs module &&
45 cat <<EOF >o_fortuna &&
64 add "O Fortuna" lyrics
66 These public domain lyrics make an excellent sample text.
68 cvs commit -F message &&
72 test_expect_success
'import a trivial module' '
74 git cvsimport -a -z 0 -C module-git module &&
75 test_cmp module-cvs/o_fortuna module-git/o_fortuna
79 test_expect_success
'pack refs' 'cd module-git && git gc && cd ..'
81 test_expect_success
'update cvs module' '
84 cat <<EOF >o_fortuna &&
99 it melts them like ice.
101 cat <<EOF >message &&
104 My Latin is terrible.
106 cvs commit -F message &&
110 test_expect_success
'update git module' '
113 git cvsimport -a -z 0 module &&
116 test_cmp module-cvs/o_fortuna module-git/o_fortuna
120 test_expect_success
'update cvs module' '
130 test_expect_success
'cvsimport.module config works' '
133 git config cvsimport.module module &&
134 git cvsimport -a -z0 &&
137 test_cmp module-cvs/tick module-git/tick
141 test_expect_success
'import from a CVS working tree' '
143 cvs co -d import-from-wt module &&
145 git cvsimport -a -z0 &&
147 git log -1 --pretty=format:%s%n >actual &&
148 test_cmp actual expect &&