6 # for clean cvsps cache
10 if ! type cvs
>/dev
/null
2>&1
12 skip_all
='skipping cvsimport tests, cvs not found'
19 cvsps_version
=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
20 case "$cvsps_version" in
24 skip_all
='skipping cvsimport tests, cvsps not found'
28 skip_all
='skipping cvsimport tests, unsupported cvsps version'
33 setup_cvs_test_repository
() {
34 CVSROOT
="$(pwd)/.cvsroot" &&
35 cp -r "$TEST_DIRECTORY/$1/cvsroot" "$CVSROOT" &&
40 # Usage: test_cvs_co BRANCH_NAME
41 rm -rf module-cvs-
"$1"
42 if [ "$1" = "master" ]
44 $CVS co
-P -d module-cvs-
"$1" -A module
46 $CVS co
-P -d module-cvs-
"$1" -r "$1" module
51 # Usage: test_git_co BRANCH_NAME
52 (cd module-git
&& git checkout
"$1")
55 test_cmp_branch_file
() {
56 # Usage: test_cmp_branch_file BRANCH_NAME PATH
57 # The branch must already be checked out of CVS and git.
58 test_cmp module-cvs-
"$1"/"$2" module-git
/"$2"
61 test_cmp_branch_tree
() {
62 # Usage: test_cmp_branch_tree BRANCH_NAME
63 # Check BRANCH_NAME out of CVS and git and make sure that all
64 # of the files and directories are identical.
70 find .
-type d
-name CVS
-prune -o -type f
-print
71 ) |
sort >module-cvs-
"$1".list
&&
74 find .
-type d
-name .git
-prune -o -type f
-print
75 ) |
sort >module-git-
"$1".list
&&
76 test_cmp module-cvs-
"$1".list module-git-
"$1".list
&&
77 cat module-cvs-
"$1".list |
while read f
79 test_cmp_branch_file
"$1" "$f" ||
return 1