(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'git cvsimport basic tests'>)} spids: [4] ) ] ) (C {<.>} {<'./lib-cvs.sh'>}) (C {<test_expect_success>} {<PERL>} {(SQ <'setup cvsroot environment'>)} {(SQ <'\n'> <'\tCVSROOT=$(pwd)/cvsroot &&\n'> <'\texport CVSROOT\n'>)} ) (C {<test_expect_success>} {<PERL>} {(SQ <'setup cvsroot'>)} {(SQ <'$CVS init'>)}) (C {<test_expect_success>} {<PERL>} {(SQ <'setup a cvs module'>)} { (SQ <'\n'> <'\n'> <'\tmkdir "$CVSROOT/module" &&\n'> <'\t$CVS co -d module-cvs module &&\n'> <'\t(cd module-cvs &&\n'> <'\tcat <<EOF >o_fortuna &&\n'> <'O Fortuna\n'> <'velut luna\n'> <'statu variabilis,\n'> <'\n'> <'semper crescis\n'> <'aut decrescis;\n'> <'vita detestabilis\n'> <'\n'> <'nunc obdurat\n'> <'et tunc curat\n'> <'ludo mentis aciem,\n'> <'\n'> <'egestatem,\n'> <'potestatem\n'> <'dissolvit ut glaciem.\n'> <'EOF\n'> <'\t$CVS add o_fortuna &&\n'> <'\tcat <<EOF >message &&\n'> <'add "O Fortuna" lyrics\n'> <'\n'> <'These public domain lyrics make an excellent sample text.\n'> <'EOF\n'> <'\t$CVS commit -F message\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {<PERL>} {(SQ <'import a trivial module'>)} { (SQ <'\n'> <'\n'> <'\tgit cvsimport -a -R -z 0 -C module-git module &&\n'> <'\ttest_cmp module-cvs/o_fortuna module-git/o_fortuna\n'> <'\n'> ) } ) (C {<test_expect_success>} {<PERL>} {(SQ <'pack refs'>)} {(SQ <'(cd module-git && git gc)'>)}) (C {<test_expect_success>} {<PERL>} {(SQ <'initial import has correct .git/cvs-revisions'>)} { (SQ <'\n'> <'\n'> <'\t(cd module-git &&\n'> <'\t git log --format="o_fortuna 1.1 %H" -1) > expected &&\n'> <'\ttest_cmp expected module-git/.git/cvs-revisions\n'> ) } ) (C {<test_expect_success>} {<PERL>} {(SQ <'update cvs module'>)} { (SQ <'\n'> <'\t(cd module-cvs &&\n'> <'\tcat <<EOF >o_fortuna &&\n'> <'O Fortune,\n'> <'like the moon\n'> <'you are changeable,\n'> <'\n'> <'ever waxing\n'> <'and waning;\n'> <'hateful life\n'> <'\n'> <'first oppresses\n'> <'and then soothes\n'> <'as fancy takes it;\n'> <'\n'> <'poverty\n'> <'and power\n'> <'it melts them like ice.\n'> <'EOF\n'> <'\tcat <<EOF >message &&\n'> <'translate to English\n'> <'\n'> <'My Latin is terrible.\n'> <'EOF\n'> <'\t$CVS commit -F message\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {<PERL>} {(SQ <'update git module'>)} { (SQ <'\n'> <'\n'> <'\t(cd module-git &&\n'> <'\tgit config cvsimport.trackRevisions true &&\n'> <'\tgit cvsimport -a -z 0 module &&\n'> <'\tgit merge origin\n'> <'\t) &&\n'> <'\ttest_cmp module-cvs/o_fortuna module-git/o_fortuna\n'> <'\n'> ) } ) (C {<test_expect_success>} {<PERL>} {(SQ <'update has correct .git/cvs-revisions'>)} { (SQ <'\n'> <'\n'> <'\t(cd module-git &&\n'> <'\t git log --format="o_fortuna 1.1 %H" -1 HEAD^ &&\n'> <'\t git log --format="o_fortuna 1.2 %H" -1 HEAD) > expected &&\n'> <'\ttest_cmp expected module-git/.git/cvs-revisions\n'> ) } ) (C {<test_expect_success>} {<PERL>} {(SQ <'update cvs module'>)} { (SQ <'\n'> <'\n'> <'\t(cd module-cvs &&\n'> <'\t\techo 1 >tick &&\n'> <'\t\t$CVS add tick &&\n'> <'\t\t$CVS commit -m 1\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {<PERL>} {(SQ <'cvsimport.module config works'>)} { (SQ <'\n'> <'\n'> <'\t(cd module-git &&\n'> <'\t\tgit config cvsimport.module module &&\n'> <'\t\tgit config cvsimport.trackRevisions true &&\n'> <'\t\tgit cvsimport -a -z0 &&\n'> <'\t\tgit merge origin\n'> <'\t) &&\n'> <'\ttest_cmp module-cvs/tick module-git/tick\n'> <'\n'> ) } ) (C {<test_expect_success>} {<PERL>} {(SQ <'second update has correct .git/cvs-revisions'>)} { (SQ <'\n'> <'\n'> <'\t(cd module-git &&\n'> <'\t git log --format="o_fortuna 1.1 %H" -1 HEAD^^ &&\n'> <'\t git log --format="o_fortuna 1.2 %H" -1 HEAD^\n'> <'\t git log --format="tick 1.1 %H" -1 HEAD) > expected &&\n'> <'\ttest_cmp expected module-git/.git/cvs-revisions\n'> ) } ) (C {<test_expect_success>} {<PERL>} {(SQ <'import from a CVS working tree'>)} { (SQ <'\n'> <'\n'> <'\t$CVS co -d import-from-wt module &&\n'> <'\t(cd import-from-wt &&\n'> <'\t\tgit config cvsimport.trackRevisions false &&\n'> <'\t\tgit cvsimport -a -z0 &&\n'> <'\t\techo 1 >expect &&\n'> <'\t\tgit log -1 --pretty=format:%s%n >actual &&\n'> <'\t\ttest_cmp actual expect\n'> <'\t)\n'> <'\n'> ) } ) (C {<test_expect_success>} {<PERL>} {(SQ <'no .git/cvs-revisions created by default'>)} {(SQ <'\n'> <'\n'> <'\t! test -e import-from-wt/.git/cvs-revisions\n'> <'\n'>)} ) (C {<test_expect_success>} {<PERL>} {(SQ <'test entire HEAD'>)} {(SQ <'test_cmp_branch_tree master'>)}) (C {<test_done>}) ] )