# # add_file "tests/t_cvsimport3.at" # # patch "ChangeLog" # from [552a799c84e8a2f7f20f9a76610f732a93e73f55] # to [56d2a8bf39e944e6e88dc371b6419682c6c2e140] # # patch "tests/t_cvsimport3.at" # from [] # to [30d8e31d2e4017b5f01aa2df6d5f4b420c65cdbb] # # patch "testsuite.at" # from [ba4c8f075ffc9901c34429f102f05e9703f251d3] # to [2b13a55317f77cf11ce47fe8157112b9ca9a9104] # --- ChangeLog +++ ChangeLog @@ -1,7 +1,10 @@ 2005-05-11 Matt Johnston * rcs_import.cc (find_branchpoint): if a branch is derived from two differing parent branches, take the one closest to the trunk. + * t_cvsimport3.at: add a test for cvs_importing where branches + come off a vendor import. + * testsuite.at: add it 2005-05-09 Matt Johnston --- tests/t_cvsimport3.at +++ tests/t_cvsimport3.at @@ -0,0 +1,111 @@ +# -*- Autoconf -*- + +AT_SETUP([importing CVS files with vendor imports and branches]) + +MONOTONE_SETUP + +AT_DATA(file1.0, [version 0 of test file1 +]) + +AT_DATA(file1.1, [version 1 of test file1 +]) + +AT_DATA(file1.2, [version 2 of test file1 +]) + +AT_DATA(file2.0, [version 0 of test file2 +]) + +AT_DATA(file2.1, [version 1 of test file2 +]) + +AT_DATA(changelog.0, [first changelog entry +]) + +AT_DATA(changelog.1 [second changelog + +first changelog entry +]) + +AT_DATA(changelog.2 [third changelog -not on branch- + +second changelog + +first changelog entry +]) + +AT_DATA(changelog.3 [third changelog -on branch- + +second changelog + +first changelog entry +]) + +F1SHA0=`SHA1(file1.0)` +F1SHA1=`SHA1(file1.1)` +F1SHA2=`SHA1(file1.2)` +F2SHA0=`SHA1(file2.0)` +T2SHA1=`SHA1(file2.1)` +CSHA0=`SHA1(changelog.0)` +CSHA1=`SHA1(changelog.1)` +CSHA2=`SHA1(changelog.2)` +CSHA3=`SHA1(changelog.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) + +# create the initial 3rd-party vendor import + +AT_CHECK(mkdir importdir) +AT_CHECK(cp file1.0 importdir/file1) +AT_CHECK(cp file2.0 importdir/file2) +AT_CHECK(cp changelog.0 importdir/changelog) +AT_CHECK(cd importdir && cvs -d $CVSROOT import -m "Initial import of VENDORWARE 1" testsrc VENDOR VENDOR_REL_1, [], [ignore], [ignore]) + +# now we alter some of the files. +AT_CHECK(cvs -d $CVSROOT co testsrc, [], [ignore], [ignore]) +AT_CHECK(cp file1.1 testsrc/file1) +AT_CHECK(cp changelog.1 testsrc/changelog) +AT_CHECK(cvs -d $CVSROOT commit -m 'commit 0' testsrc, [], [ignore], [ignore]) + +# now we create a branch +AT_CHECK(cvs -d $CVSROOT tag -b branched testsrc, [], [ignore], [ignore]) +AT_CHECK(cvs -d $CVSROOT up -r branched testsrc, [], [ignore], [ignore]) + +# alter the files on the branch +AT_CHECK(cp file1.2 testsrc/file1) +AT_CHECK(cp file2.1 testsrc/file2) +AT_CHECK(cp changelog.3 testsrc/changelog) +AT_CHECK(cvs -d $CVSROOT commit -m 'commit on branch' testsrc, [], [ignore], [ignore]) + +# and create some mainline changes after the branch +AT_CHECK(cvs -d $CVSROOT up -A testsrc, [], [ignore]) +AT_CHECK(cp changelog.2 testsrc/changelog) +AT_CHECK(cvs -d $CVSROOT commit -m 'commit on mainline after branch' testsrc, [], [ignore], [ignore]) + +# import into monotone and check presence of files + +# safety check -- we stop people from accidentally feeding their whole +# repo to cvs_import instead of just a module. +AT_CHECK(MONOTONE --branch=test cvs_import $CVSROOT/testsrc, [], [ignore], [ignore]) + +# also check that checkout is correct +# right one. + +AT_CHECK(MONOTONE checkout --branch=test maindir, [], [ignore], [ignore]) +AT_CHECK(MONOTONE checkout --branch=test.branched branchdir, [], [ignore], [ignore]) + +AT_CHECK(cmp file1.1 maindir/file1) +AT_CHECK(cmp file2.0 maindir/file2) +AT_CHECK(cmp changelog.2 maindir/changelog) + +AT_CHECK(cmp file1.2 branchdir/file1) +AT_CHECK(cmp file2.1 branchdir/file2) +AT_CHECK(cmp changelog.3 branchdir/changelog) + +AT_CLEANUP --- testsuite.at +++ testsuite.at @@ -612,3 +612,4 @@ m4_include(tests/t_monotone_up.at) m4_include(tests/t_drop_vs_patch_rename.at) m4_include(tests/t_unreadable_MT.at) +m4_include(tests/t_cvsimport3.at)