# # add_file "tests/t_cvspull_combined.at" # # patch "tests/t_cvspull_combined.at" # from [] # to [a6f5172bf97e8ac333432adb80b4d29b8c990f37] # # patch "testsuite.at" # from [7e3aab74abef35983cc35026260c1cc4b4d1654c] # to [5fbbb1904db954d7ad53058e242d832beaca54b1] # --- tests/t_cvspull_combined.at +++ tests/t_cvspull_combined.at @@ -0,0 +1,80 @@ +# -*- Autoconf -*- + +AT_SETUP([pull of CVS module with complex history]) + +MONOTONE_SETUP + +AT_DATA(d_import, [initial import +]) +AT_DATA(d_add, [file added +]) +AT_DATA(d_change, [something different +]) +AT_DATA(d_subdir, [some subdir +]) +AT_DATA(d_readd, [revived +]) + +TSHA0=`SHA1(d_import)` +TSHA1=`SHA1(d_add)` +TSHA2=`SHA1(d_change)` +TSHA3=`SHA1(d_subdir)` +TSHA4=`SHA1(d_readd)` + +# build the cvs repository + +CVSROOT=`pwd`/cvs-repository +AT_CHECK(cvs -q -d $CVSROOT init) +AT_CHECK(test -e $CVSROOT) +AT_CHECK(test -e $CVSROOT/CVSROOT) +AT_CHECK(test -e $CVSROOT/CVSROOT/history) + +# check out the CVSROOT admin module and edit the rcsinfo file to give ourself a commit template + +AT_CHECK(mkdir cvstemp) +AT_CHECK(cp d_import cvstemp/A) +AT_CHECK([cd cvstemp ; cvs -q -d $CVSROOT import -m 'initial import' test vendor_tag initial_import], [], [ignore], [ignore]) + +AT_CHECK([cvs -q -d $CVSROOT co test], [], [ignore], [ignore]) +AT_CHECK(cp d_add test/B) +AT_CHECK([cd test;cvs -Q add B]) +AT_CHECK([sleep 1;cd test;cvs -Q ci -m 'B added']) + +AT_CHECK([cd test;cvs -Q delete -f A]) +AT_CHECK([cd test;sleep 1;cvs -Q ci -m 'A removed']) + +AT_CHECK(cp d_change test/B) +AT_CHECK([cd test;sleep 1;cvs -Q ci -m 'B changed']) + +AT_CHECK(mkdir test/dir) +AT_CHECK([cd test;cvs -Q add dir]) +AT_CHECK(cp d_subdir test/dir/D) +AT_CHECK([cd test;cvs -Q add dir/D]) +AT_CHECK([cd test;sleep 1;cvs -Q ci -m 'dir/D added']) + +AT_CHECK(cp d_readd test/A) +AT_CHECK([cd test;cvs -Q add A]) +AT_CHECK([cd test;sleep 1;cvs -Q ci -m 'A readded']) + +# pull into monotone + +AT_CHECK(MONOTONE --branch=testbranch cvs_pull $CVSROOT test, [], [ignore], [ignore]) + + +# check presence of files + +AT_CHECK(MONOTONE cat file $TSHA0, [], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA1, [], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA2, [], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA3, [], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA4, [], [ignore]) + +# also check that history is okay -- has a unique head, and it's the +# right one. + +AT_CHECK(MONOTONE checkout --branch=testbranch mtcodir, [], [ignore], [ignore]) +AT_CHECK(cmp d_readd mtcodir/A) +AT_CHECK(cmp d_change mtcodir/B) +AT_CHECK(cmp d_subdir mtcodir/dir/D) + +AT_CLEANUP --- testsuite.at +++ testsuite.at @@ -551,5 +551,6 @@ m4_include(tests/t_netsync_largish_file.at) m4_include(tests/t_update_off_branch.at) m4_include(tests/t_setup_checkout_modify_new_dir.at) +m4_include(tests/t_cvspull_combined.at) m4_include(tests/t_cvspull_committemplate.at) m4_include(tests/t_cvspull_samedirname.at)