# # add_file "tests/t_cvstakeover_modified.at" # # patch "cvs_repository.cc" # from [24e0671f09dcda298120a3c8d36c6eae060a4961] # to [951f1f6f54cdd2d0c98c46761bc2e41345733b2f] # # patch "tests/t_cvstakeover_modified.at" # from [] # to [ae6f3510942f95a0fd7b026b7bddc7571f4da8d4] # # patch "testsuite.at" # from [ef836538ad43501be9ce3f2e823c44e5601288ae] # to [d115588bb96d7f79d17441916c21474da57a41f9] # ======================================================================== --- cvs_repository.cc 24e0671f09dcda298120a3c8d36c6eae060a4961 +++ cvs_repository.cc 951f1f6f54cdd2d0c98c46761bc2e41345733b2f @@ -964,7 +964,12 @@ { content+="+"+e.delta_base.inner()()+"\n"; } for (cvs_manifest::const_iterator i=e.xfiles.begin(); i!=e.xfiles.end(); ++i) - { content+=i->second->cvs_version; + { if (i->second->cvs_version.empty()) + { W(F("blocking attempt to certify an empty CVS revision\n" + "(this is normal for a cvs_takeover of a locally modified tree)\n")); + return; + } + content+=i->second->cvs_version; if (!i->second->keyword_substitution.empty()) content+="/"+i->second->keyword_substitution; content+=" "+i->first+"\n"; @@ -1460,6 +1465,7 @@ } revision_lookup[e.revision]=edges.insert(e).first; } + else L(F("cvs cert %s ignored (!=%s)") % cvs_revisions % needed_cert); } // because some manifests might have been absolute (not delta encoded) // we possibly did not notice removes. check for them ======================================================================== --- tests/t_cvstakeover_modified.at +++ tests/t_cvstakeover_modified.at ae6f3510942f95a0fd7b026b7bddc7571f4da8d4 @@ -0,0 +1,60 @@ +# -*- Autoconf -*- + +AT_SETUP([take over a modified CVS checkout and push changes into CVS]) + +MONOTONE_SETUP + +AT_DATA(d_import, [initial import +]) +AT_DATA(d_add, [file added +]) +AT_DATA(d_change, [something different +]) + +TSHA0=`SHA1(d_import)` +TSHA1=`SHA1(d_add)` +TSHA2=`SHA1(d_change)` + +# 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) + +# import a test project + +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]) + +# change the repository in various ways + +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;MONOTONE --root . --branch testbranch cvs_takeover test], [0], [ignore], [ignore]) + +AT_CHECK(MONOTONE --branch testbranch cvs_push, [0], [ignore], [ignore]) +######## +# check presence of files + +AT_CHECK(MONOTONE automate get_file $TSHA0, [], [ignore]) +AT_CHECK(MONOTONE automate get_file $TSHA1, [], [ignore]) +AT_CHECK(MONOTONE automate get_file $TSHA2, [], [ignore]) + +# also check that CVS sees this newly changed file + +AT_CHECK(mv test test.old) +AT_CHECK([cvs -q -d $CVSROOT co test], [], [ignore], [ignore]) +AT_CHECK(cmp d_change test/B) + +AT_CLEANUP ======================================================================== --- testsuite.at ef836538ad43501be9ce3f2e823c44e5601288ae +++ testsuite.at d115588bb96d7f79d17441916c21474da57a41f9 @@ -610,6 +610,7 @@ m4_include(tests/t_cvspull_separate.at) m4_include(tests/t_cvspull_committemplate.at) m4_include(tests/t_cvspull_samedirname.at) +m4_include(tests/t_cvstakeover_modified.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)