Merge branch 'jn/maint-gitweb-pathinfo-fix'
[git/mingw.git] / t / t9600-cvsimport.sh
blob432b82e3d5a361d0eba329f5d5c56c17009738db
1 #!/bin/sh
3 test_description='git cvsimport basic tests'
4 . ./lib-cvs.sh
6 test_expect_success PERL 'setup cvsroot environment' '
7 CVSROOT=$(pwd)/cvsroot &&
8 export CVSROOT
11 test_expect_success PERL 'setup cvsroot' '$CVS init'
13 test_expect_success PERL 'setup a cvs module' '
15 mkdir "$CVSROOT/module" &&
16 $CVS co -d module-cvs module &&
17 (cd module-cvs &&
18 cat <<EOF >o_fortuna &&
19 O Fortuna
20 velut luna
21 statu variabilis,
23 semper crescis
24 aut decrescis;
25 vita detestabilis
27 nunc obdurat
28 et tunc curat
29 ludo mentis aciem,
31 egestatem,
32 potestatem
33 dissolvit ut glaciem.
34 EOF
35 $CVS add o_fortuna &&
36 cat <<EOF >message &&
37 add "O Fortuna" lyrics
39 These public domain lyrics make an excellent sample text.
40 EOF
41 $CVS commit -F message
45 test_expect_success PERL 'import a trivial module' '
47 git cvsimport -a -R -z 0 -C module-git module &&
48 test_cmp module-cvs/o_fortuna module-git/o_fortuna
52 test_expect_success PERL 'pack refs' '(cd module-git && git gc)'
54 test_expect_success PERL 'initial import has correct .git/cvs-revisions' '
56 (cd module-git &&
57 git log --format="o_fortuna 1.1 %H" -1) > expected &&
58 test_cmp expected module-git/.git/cvs-revisions
61 test_expect_success PERL 'update cvs module' '
62 (cd module-cvs &&
63 cat <<EOF >o_fortuna &&
64 O Fortune,
65 like the moon
66 you are changeable,
68 ever waxing
69 and waning;
70 hateful life
72 first oppresses
73 and then soothes
74 as fancy takes it;
76 poverty
77 and power
78 it melts them like ice.
79 EOF
80 cat <<EOF >message &&
81 translate to English
83 My Latin is terrible.
84 EOF
85 $CVS commit -F message
89 test_expect_success PERL 'update git module' '
91 (cd module-git &&
92 git cvsimport -a -R -z 0 module &&
93 git merge origin
94 ) &&
95 test_cmp module-cvs/o_fortuna module-git/o_fortuna
99 test_expect_success PERL 'update has correct .git/cvs-revisions' '
101 (cd module-git &&
102 git log --format="o_fortuna 1.1 %H" -1 HEAD^ &&
103 git log --format="o_fortuna 1.2 %H" -1 HEAD) > expected &&
104 test_cmp expected module-git/.git/cvs-revisions
107 test_expect_success PERL 'update cvs module' '
109 (cd module-cvs &&
110 echo 1 >tick &&
111 $CVS add tick &&
112 $CVS commit -m 1
116 test_expect_success PERL 'cvsimport.module config works' '
118 (cd module-git &&
119 git config cvsimport.module module &&
120 git cvsimport -a -R -z0 &&
121 git merge origin
122 ) &&
123 test_cmp module-cvs/tick module-git/tick
127 test_expect_success PERL 'second update has correct .git/cvs-revisions' '
129 (cd module-git &&
130 git log --format="o_fortuna 1.1 %H" -1 HEAD^^ &&
131 git log --format="o_fortuna 1.2 %H" -1 HEAD^
132 git log --format="tick 1.1 %H" -1 HEAD) > expected &&
133 test_cmp expected module-git/.git/cvs-revisions
136 test_expect_success PERL 'import from a CVS working tree' '
138 $CVS co -d import-from-wt module &&
139 (cd import-from-wt &&
140 git cvsimport -a -z0 &&
141 echo 1 >expect &&
142 git log -1 --pretty=format:%s%n >actual &&
143 test_cmp actual expect
148 test_expect_success PERL 'no .git/cvs-revisions created by default' '
150 ! test -e import-from-wt/.git/cvs-revisions
154 test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree master'
156 test_done