# # add_file "tests/t_cvspull_samedirname.at" # # patch "tests/t_cvspull_samedirname.at" # from [] # to [347b2f228eb1cc4a3bfba5e98f0566067e0135b9] # # patch "testsuite.at" # from [39bb6aec8093accd6899e52f691e71fc2fef932b] # to [7e3aab74abef35983cc35026260c1cc4b4d1654c] # --- tests/t_cvspull_samedirname.at +++ tests/t_cvspull_samedirname.at @@ -0,0 +1,73 @@ +# -*- Autoconf -*- + +AT_SETUP([pull of CVS module that has a subdirectory with the same name as the module]) + +MONOTONE_SETUP + +AT_DATA(importme.0, [version 0 of test file +]) + +AT_DATA(importme.1, [version 1 of test file +]) + +AT_DATA(importme.2, [version 2 of test file +]) + +AT_DATA(importme.3, [version 3 of test file +]) + +AT_DATA(committemplate, [This is my commit template +]) +AT_DATA(newrcsinfo, [ALL `pwd`/committemplate +]) + +TSHA0=`SHA1(importme.0)` +TSHA1=`SHA1(importme.1)` +TSHA2=`SHA1(importme.2)` +TSHA3=`SHA1(importme.3)` + +# 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 working copy and make some commits + +AT_CHECK(cvs -d $CVSROOT co ., [], [ignore], [ignore]) +AT_CHECK(mkdir testdir) +AT_CHECK(cp importme.0 testdir/importme) +AT_CHECK(cvs -d $CVSROOT add testdir, [], [ignore], [ignore]) +AT_CHECK(cvs -d $CVSROOT add testdir/importme, [], [ignore], [ignore]) +AT_CHECK(cvs -d $CVSROOT commit -m 'commit 0' testdir/importme, [], [ignore], [ignore]) +AT_CHECK(cp importme.1 testdir/importme) +AT_CHECK(cvs -d $CVSROOT commit -m 'commit 1' testdir/importme, [], [ignore], [ignore]) +AT_CHECK(cp importme.2 testdir/importme) +AT_CHECK(cvs -d $CVSROOT commit -m 'commit 2' testdir/importme, [], [ignore], [ignore]) +AT_CHECK(mkdir testdir/testdir, [], [ignore], [ignore]) +AT_CHECK(cp importme.3 testdir/testdir/importme) +AT_CHECK(cvs -d $CVSROOT add testdir/testdir, [], [ignore], [ignore]) +AT_CHECK(cvs -d $CVSROOT add testdir/testdir/importme, [], [ignore], [ignore]) +AT_CHECK(cvs -d $CVSROOT commit -m 'commit 3' testdir/, [], [ignore], [ignore]) + +# pull into monotone + +AT_CHECK(MONOTONE --branch=testbranch cvs_pull $CVSROOT testdir, [], [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]) + +# 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 importme.3 mtcodir/importme) + +AT_CLEANUP --- testsuite.at +++ testsuite.at @@ -552,3 +552,4 @@ m4_include(tests/t_update_off_branch.at) m4_include(tests/t_setup_checkout_modify_new_dir.at) m4_include(tests/t_cvspull_committemplate.at) +m4_include(tests/t_cvspull_samedirname.at)