3 test_description
='git-cvsimport basic tests'
6 if ! type cvs
>/dev
/null
2>&1
8 say
'skipping cvsimport tests, cvs not found'
13 cvsps_version
=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
14 case "$cvsps_version" in
18 say
'skipping cvsimport tests, cvsps not found'
23 say
'skipping cvsimport tests, cvsps too old'
29 CVSROOT
=$
(pwd)/cvsroot
31 # for clean cvsps cache
35 test_expect_success
'setup cvsroot' 'cvs init'
37 test_expect_success
'setup a cvs module' '
39 mkdir $CVSROOT/module &&
40 cvs co -d module-cvs module &&
42 cat <<EOF >o_fortuna &&
61 add "O Fortuna" lyrics
63 These public domain lyrics make an excellent sample text.
65 cvs commit -F message &&
69 test_expect_success
'import a trivial module' '
71 git cvsimport -a -z 0 -C module-git module &&
72 git diff module-cvs/o_fortuna module-git/o_fortuna
76 test_expect_success
'pack refs' 'cd module-git && git gc && cd ..'
78 test_expect_success
'update cvs module' '
81 cat <<EOF >o_fortuna &&
96 it melts them like ice.
101 My Latin is terrible.
103 cvs commit -F message &&
107 test_expect_success
'update git module' '
110 git cvsimport -a -z 0 module &&
113 git diff module-cvs/o_fortuna module-git/o_fortuna
117 test_expect_success
'update cvs module' '
127 test_expect_success
'cvsimport.module config works' '
130 git config cvsimport.module module &&
131 git cvsimport -a -z0 &&
134 git diff module-cvs/tick module-git/tick
138 test_expect_success
'import from a CVS working tree' '
140 cvs co -d import-from-wt module &&
142 git cvsimport -a -z0 &&
144 git log -1 --pretty=format:%s%n >actual &&
145 git diff actual expect &&