# # # add_file "tests/t_cvsimport_branch.at" # content [d5bcc9ee933be0f2711d9e81f005dfbd8d1ca3e8] # # patch "ChangeLog" # from [8b11ecd7d68d0cb630313b372ed8ec4dd5e3a344] # to [8b196fa24d8f4d3e603a26e04c5ad3af6cf933e6] # # patch "testsuite.at" # from [80c4c93321cbbc480f7743a17bf199722cf7a739] # to [cf0da0d091365cf44bc09c758eb1b0a91bb4db57] # ============================================================ --- tests/t_cvsimport_branch.at d5bcc9ee933be0f2711d9e81f005dfbd8d1ca3e8 +++ tests/t_cvsimport_branch.at d5bcc9ee933be0f2711d9e81f005dfbd8d1ca3e8 @@ -0,0 +1,127 @@ +# -*- Autoconf -*- + +AT_SETUP([importing CVS branches with correct ancestory]) + +MONOTONE_SETUP + +AT_XFAIL_IF(true) + +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 +]) + +AT_DATA(branchlist, [test +test.branched +]) + +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, [0], [ignore], [ignore]) +AT_CHECK(test -e $CVSROOT) +AT_CHECK(test -e $CVSROOT/CVSROOT) +AT_CHECK(test -e $CVSROOT/CVSROOT/modules) + +# checkout the empty repository and commit some files + +AT_CHECK(cvs -d $CVSROOT co ., [], [ignore], [ignore]) +AT_CHECK(mkdir testdir) +AT_CHECK(cp file1.0 testdir/file1) +AT_CHECK(cp file2.0 testdir/file2) +AT_CHECK(cp changelog.0 testdir/changelog) +AT_CHECK(cvs -d $CVSROOT add testdir, [], [ignore], [ignore]) +AT_CHECK(cvs -d $CVSROOT add testdir/file1, [], [ignore], [ignore]) +AT_CHECK(cvs -d $CVSROOT add testdir/file2, [], [ignore], [ignore]) +AT_CHECK(cvs -d $CVSROOT add testdir/changelog, [], [ignore], [ignore]) +AT_CHECK(cvs -d $CVSROOT commit -m 'initial import' testdir/file1 testdir/file2 testdir/changelog, [], [ignore], [ignore]) + +# commit first changes +AT_CHECK(cp file1.1 testdir/file1) +AT_CHECK(cp changelog.1 testdir/changelog) +AT_CHECK(cvs -d $CVSROOT commit -m 'first commit' testdir/file1 testdir/changelog, [], [ignore], [ignore]) + +# now we create a branch +AT_CHECK(cd testdir; cvs -d $CVSROOT tag -b branched, [], [ignore], [ignore]) +AT_CHECK(cd testdir; cvs -d $CVSROOT up -r branched, [], [ignore], [ignore]) + +# alter the files on the branch +AT_CHECK(cp file2.1 testdir/file2) +AT_CHECK(cp changelog.3 testdir/changelog) +AT_CHECK(cvs -d $CVSROOT commit -m 'commit on branch' testdir/file2 testdir/changelog, [], [ignore], [ignore]) + +# and create some mainline changes after the branch +AT_CHECK(cvs -d $CVSROOT up -A, [], [ignore], [ignore]) +AT_CHECK(cp file1.2 testdir/file1) +AT_CHECK(cp changelog.2 testdir/changelog) +AT_CHECK(cvs -d $CVSROOT commit -m 'commit on mainline after branch' testdir/file1 testdir/changelog, [], [ignore], [ignore]) + +# import into monotone and check presence of files +AT_CHECK(MONOTONE --branch=test cvs_import $CVSROOT/testdir, [], [ignore], [ignore]) + +# check if all branches were imported +AT_CHECK(MONOTONE list branches, [], [stdout], [ignore]) +AT_CHECK(cmp stdout branchlist) + +# checkout the imported repository into maindir and branchdir +AT_CHECK(MONOTONE checkout --branch=test maindir, [], [ignore], [ignore]) +AT_CHECK(MONOTONE checkout --branch=test.branched branchdir, [], [ignore], [ignore]) + +# check for correctness of the files in the main tree +AT_CHECK(cmp file1.2 maindir/file1) +AT_CHECK(cmp file2.0 maindir/file2) +AT_CHECK(cmp changelog.2 maindir/changelog) + +# check for correctness of the files in the branch +AT_CHECK(cmp file1.1 branchdir/file1) +AT_CHECK(cmp file2.1 branchdir/file2) +AT_CHECK(cmp changelog.3 branchdir/changelog) + +# get the log of the branch to check for correct branchpoint +AT_CHECK(cd branchdir; MONOTONE log, [], [stdout], [ignore]) +AT_CHECK(grep "commit on branch" stdout, [], [ignore], [ignore]) +AT_CHECK(grep "initial import" stdout, [], [ignore], [ignore]) + +AT_CLEANUP ============================================================ --- ChangeLog 8b11ecd7d68d0cb630313b372ed8ec4dd5e3a344 +++ ChangeLog 8b196fa24d8f4d3e603a26e04c5ad3af6cf933e6 @@ -1,3 +1,8 @@ +2006-02-18 Markus Schiltknecht + + * tests/t_cvsimport_branch.at, testsuite.at: New XFAIL test for + cvs_import branch reconstruction. + 2006-02-18 Matthew Gregan * tests/t_db_kill_rev_locally_2.at: Add an XFAIL test for a ============================================================ --- testsuite.at 80c4c93321cbbc480f7743a17bf199722cf7a739 +++ testsuite.at cf0da0d091365cf44bc09c758eb1b0a91bb4db57 @@ -759,3 +759,4 @@ m4_include(tests/t_ls_changed.at) m4_include(tests/t_revert_new_project.at) m4_include(tests/t_db_kill_rev_locally_2.at) +m4_include(tests/t_cvsimport_branch.at)