# # add_file "tests/t_cvspull_rapid.at" # # add_file "tests/t_cvspull_xmodule.at" # # patch "cvs_client.cc" # from [3590736af6215bf93a551fd935660d76a6a247fe] # to [7799a14f2026f9fc936fee6d92fbb9396ebd697c] # # patch "tests/t_cvspull_rapid.at" # from [] # to [b43c096686e0539cb710dc241aed5e42523600ea] # # patch "tests/t_cvspull_xmodule.at" # from [] # to [bb83d36acd905331d26be2f105b0f85a076df537] # # patch "testsuite.at" # from [77c5e7bf50f2132fe9a5bec610312f175b6fc049] # to [30651dbe60303926e9b760bcd560a5a5f7ca3343] # ======================================================================== --- cvs_client.cc 3590736af6215bf93a551fd935660d76a6a247fe +++ cvs_client.cc 7799a14f2026f9fc936fee6d92fbb9396ebd697c @@ -81,7 +81,8 @@ Netxx::PipeCompatibleProbe probe; probe.add(*stream, Netxx::Probe::ready_read); try_again: - Netxx::Probe::result_type res = probe.ready(Netxx::Timeout(120L)); // 120 seconds + Netxx::Probe::result_type res = probe.ready(Netxx::Timeout(60L), + Netxx::Probe::ready_read); // 60 seconds E((res.second&Netxx::Probe::ready_read),F("timeout reading from CVS server")); ssize_t avail_in=stream->read(buf,sizeof buf); E(avail_in>0, F("read error %s") % strerror(errno)); ======================================================================== --- tests/t_cvspull_rapid.at +++ tests/t_cvspull_rapid.at b43c096686e0539cb710dc241aed5e42523600ea @@ -0,0 +1,47 @@ +# -*- Autoconf -*- + +AT_SETUP([pull of CVS module with rapidly changed history]) + +MONOTONE_SETUP + +# 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) + +# fake a test project + +AT_CHECK(mkdir $CVSROOT/test) + +# change the repository in various ways + +AT_CHECK([cvs -q -d $CVSROOT co test], [], [ignore], [ignore]) +AT_CHECK([echo "fast A" >test/A]) +AT_CHECK([echo "fast B" >test/B]) +AT_CHECK([echo "fast C" >test/C]) +AT_CHECK([echo "fast D" >test/D]) +AT_CHECK([cd test;cvs -Q add A;cvs -Q ci -m "fast A change"]) +AT_CHECK([cd test;cvs -Q add C;cvs -Q ci -m "fast C change"]) +AT_CHECK([cd test;cvs -Q add B;cvs -Q ci -m "fast B add"]) +AT_CHECK([cd test;cvs -Q add D;cvs -Q ci -m "fast D change"]) +AT_CHECK([echo "fast A change" >test/A]) +AT_CHECK([echo "fast B change" >test/B]) +AT_CHECK([echo "fast C change" >test/C]) +AT_CHECK([echo "fast D change" >test/D]) +AT_CHECK([cd test;cvs -Q ci -m "fast D change" D]) +AT_CHECK([cd test;cvs -Q ci -m "fast C change" C]) +AT_CHECK([cd test;cvs -Q ci -m "fast B change" B]) +AT_CHECK([cd test;cvs -Q ci -m "fast A change" A]) + +# pull into monotone + +AT_CHECK(MONOTONE --branch=testbranch cvs_pull $CVSROOT test, [], [ignore], [ignore]) + +# also check that history is okay -- has a unique head + +AT_CHECK(MONOTONE checkout --branch=testbranch mtcodir, [], [ignore], [ignore]) + +AT_CLEANUP ======================================================================== --- tests/t_cvspull_xmodule.at +++ tests/t_cvspull_xmodule.at bb83d36acd905331d26be2f105b0f85a076df537 @@ -0,0 +1,77 @@ +# -*- Autoconf -*- + +AT_SETUP([pull of CVS module with rapidly changed history]) + +MONOTONE_SETUP + +# 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) + +# fake a test project + +AT_CHECK(mkdir $CVSROOT/test) + +# change the repository in various ways + +mkdir $CVSROOT/test2 + +mkdir test.cvstemp +cd test.cvstemp +cvs -Q -d $CVSROOT co CVSROOT +cd CVSROOT +echo >>modules test1 test +echo >>modules test3 test2 '&test1' +cvs -Q ci -m "module setup" +cd .. + +cvs -Q -d $CVSROOT co test3 +cd test3 + +echo >AA initial AA +cvs -Q add AA +cvs -Q ci -m "AA added" + +mkdir sub2 +cvs -Q add sub2 +echo >sub2/BB initial BB +cvs -Q add sub2/BB +cvs -Q ci -m "sub2/BB added" + +echo >test1/A cross module change +cvs -Q ci -m "cross module change of A" + +cd $CVSROOT/.. +rm -rf test.cvstemp || exit 1 + +AT_CHECK([cvs -q -d $CVSROOT co test], [], [ignore], [ignore]) +AT_CHECK([echo "fast A" >test/A]) +AT_CHECK([echo "fast B" >test/B]) +AT_CHECK([echo "fast C" >test/C]) +AT_CHECK([echo "fast D" >test/D]) +AT_CHECK([cd test;cvs -Q add A;cvs -Q ci -m "fast A change"]) +AT_CHECK([cd test;cvs -Q add C;cvs -Q ci -m "fast C change"]) +AT_CHECK([cd test;cvs -Q add B;cvs -Q ci -m "fast B add"]) +AT_CHECK([cd test;cvs -Q add D;cvs -Q ci -m "fast D change"]) +AT_CHECK([echo "fast A change" >test/A]) +AT_CHECK([echo "fast B change" >test/B]) +AT_CHECK([echo "fast C change" >test/C]) +AT_CHECK([echo "fast D change" >test/D]) +AT_CHECK([cd test;cvs -Q ci -m "fast D change" D]) +AT_CHECK([cd test;cvs -Q ci -m "fast C change" C]) +AT_CHECK([cd test;cvs -Q ci -m "fast B change" B]) +AT_CHECK([cd test;cvs -Q ci -m "fast A change" A]) + +# pull into monotone + +AT_CHECK(MONOTONE --branch=testbranch cvs_pull $CVSROOT test, [], [ignore], [ignore]) + +# also check that history is okay -- has a unique head + +AT_CHECK(MONOTONE checkout --branch=testbranch mtcodir, [], [ignore], [ignore]) + +AT_CLEANUP ======================================================================== --- testsuite.at 77c5e7bf50f2132fe9a5bec610312f175b6fc049 +++ testsuite.at 30651dbe60303926e9b760bcd560a5a5f7ca3343 @@ -613,6 +613,7 @@ m4_include(tests/t_cvstakeover_modified.at) m4_include(tests/t_cvspush_loop.at) m4_include(tests/t_cvspull_cvsbranch.at) +m4_include(tests/t_cvspull_rapid.at) m4_include(tests/t_rename_dir_add_dir_with_old_name.at) m4_include(tests/t_rcs_import.at) m4_include(tests/t_cvsimport2.at)