# # # add_dir "tests/importing_cvs_branches7" # # add_dir "tests/importing_cvs_branches7/cvs-repository" # # add_dir "tests/importing_cvs_branches7/cvs-repository/test" # # add_file "tests/importing_cvs_branches7/__driver__.lua" # content [eeae29f7b7ab56b1a3003f9bcd7482e4cecc13fa] # # add_file "tests/importing_cvs_branches7/cvs-repository/test/file1,v" # content [524dd5db59e4ec39e6a6a2e2800a3c573435a929] # # add_file "tests/importing_cvs_branches7/makerepo.sh" # content [5fe0c83d84e1960c876ee944ddf7a271b0c91d56] # # set "tests/importing_cvs_branches7/makerepo.sh" # attr "mtn:execute" # value "true" # ============================================================ --- tests/importing_cvs_branches7/__driver__.lua eeae29f7b7ab56b1a3003f9bcd7482e4cecc13fa +++ tests/importing_cvs_branches7/__driver__.lua eeae29f7b7ab56b1a3003f9bcd7482e4cecc13fa @@ -0,0 +1,53 @@ + +mtn_setup() + + +-- There's a makerepo.sh as well, but the repository for this test has +-- been edited as follows: the timestamp from 1.2 is being copied to +-- revisions 1.1.2.2, 1.1.4.2 and 1.1.6.2 to trigger the following +-- nasty effect. +check(get("cvs-repository")) + +-- +-- Branch layout overview: +-- +-- ROOT +-- / | \ +-- A B C +-- +-- Root contains file1. All branches are created and file1 gets a first +-- modification. Then a patch - often some sort of a backport - gets +-- applied to the ROOT, but at the same time also to all branches. That +-- easily ends up with multiple commits having the same timestamp, author +-- and changelog. + +writefile("file1-1.2", "version 1.2 of test file1\n") +writefile("file1-1.1.2.2", "version 1.1.2.2 of test file1\n") +writefile("file1-1.1.4.2", "version 1.1.4.2 of test file1\n") +writefile("file1-1.1.6.2", "version 1.1.6.2 of test file1\n") + +-- import into monotone and check presence of files +check(mtn("--branch=test", "cvs_import", "cvs-repository/test", "--debug"), 0, false, false) + +-- check if all non-empty branches were imported +check(mtn("list", "branches"), 0, true, false) +check(samelines("stdout", {"test", "test.A", "test.B", "test.C"})) + +-- checkout the imported repository into maindir and branchdir +check(mtn("checkout", "--branch=test", "maindir"), 0, false, false) +check(mtn("checkout", "--branch=test.A", "branchA"), 0, false, false) +check(mtn("checkout", "--branch=test.B", "branchB"), 0, false, false) +check(mtn("checkout", "--branch=test.C", "branchC"), 0, false, false) + +-- check for correct contents of the file in the main tree +check(samefile("file1-1.2", "maindir/file1")) + +-- check for correct contents of the file in branch A +check(samefile("file1-1.1.2.2", "branchA/file1")) + +-- check for correct contents of the file in branch B +check(samefile("file1-1.1.4.2", "branchB/file1")) + +-- check for correct contents of the file in branch C +check(samefile("file1-1.1.6.2", "branchC/file1")) + ============================================================ --- tests/importing_cvs_branches7/cvs-repository/test/file1,v 524dd5db59e4ec39e6a6a2e2800a3c573435a929 +++ tests/importing_cvs_branches7/cvs-repository/test/file1,v 524dd5db59e4ec39e6a6a2e2800a3c573435a929 @@ -0,0 +1,152 @@ +head 1.2; +access; +symbols + C:1.1.0.6 + B:1.1.0.4 + A:1.1.0.2; +locks; strict; +comment @# @; + + +1.2 +date 2008.07.16.13.06.05; author markus; state Exp; +branches; +next 1.1; +commitid 8RiMtkoePLxCT1bt; + +1.1 +date 2008.07.16.13.05.47; author markus; state Exp; +branches + 1.1.2.1 + 1.1.4.1 + 1.1.6.1; +next ; +commitid YesXJgzrrjWvT1bt; + +1.1.2.1 +date 2008.07.16.13.05.48; author markus; state Exp; +branches; +next 1.1.2.2; +commitid asdnfQzarjxwT1bt; + +1.1.2.2 +date 2008.07.16.13.06.05; author markus; state Exp; +branches; +next ; +commitid CcyMiZOsDBrxT1bt; + +1.1.4.1 +date 2008.07.16.13.05.53; author markus; state Exp; +branches; +next 1.1.4.2; +commitid BUrau5Lp6abyT1bt; + +1.1.4.2 +date 2008.07.16.13.06.05; author markus; state Exp; +branches; +next ; +commitid iQumH0lh1DbzT1bt; + +1.1.6.1 +date 2008.07.16.13.05.58; author markus; state Exp; +branches; +next 1.1.6.2; +commitid yRka5C582pOzT1bt; + +1.1.6.2 +date 2008.07.16.13.06.05; author markus; state Exp; +branches; +next ; +commitid YLb6qtcg9l9BT1bt; + + +desc +@@ + + +1.2 +log address@hidden COMMIT +@ +text address@hidden 1.2 of test file1 +@ + + +1.1 +log address@hidden import +@ +text address@hidden 1 +a1 1 +version 1.1 of test file1 +@ + + +1.1.6.1 +log address@hidden branch C +@ +text address@hidden 1 +a1 1 +version 1.1.6.1 of test file1 +@ + + +1.1.6.2 +log address@hidden COMMIT +@ +text address@hidden 1 +a1 1 +version 1.1.6.2 of test file1 +@ + + +1.1.4.1 +log address@hidden branch B +@ +text address@hidden 1 +a1 1 +version 1.1.4.1 of test file1 +@ + + +1.1.4.2 +log address@hidden COMMIT +@ +text address@hidden 1 +a1 1 +version 1.1.4.2 of test file1 +@ + + +1.1.2.1 +log address@hidden branch A +@ +text address@hidden 1 +a1 1 +version 1.1.2.1 of test file1 +@ + + +1.1.2.2 +log address@hidden COMMIT +@ +text address@hidden 1 +a1 1 +version 1.1.2.2 of test file1 +@ + + ============================================================ --- tests/importing_cvs_branches7/makerepo.sh 5fe0c83d84e1960c876ee944ddf7a271b0c91d56 +++ tests/importing_cvs_branches7/makerepo.sh 5fe0c83d84e1960c876ee944ddf7a271b0c91d56 @@ -0,0 +1,75 @@ +#!/bin/sh + +CVSROOT=`pwd`/cvs-repository +export CVSROOT + +# deleting the existing cvs-repository +rm -vrf $CVSROOT + +# initializing a new repository +cvs init + +# do a full checkout of the repository +mkdir full_checkout +cd full_checkout +cvs co . +mkdir test +cvs add test +cd test + +# checkout the empty repository and commit a file +echo "version 1.1 of test file1" > file1 +cvs add file1 +cvs commit -m "initial import" file1 + +# now we create a branch A +cvs tag -b A +cvs update -r A +echo "version 1.1.2.1 of test file1" > file1 +cvs commit -m "created branch A" file1 + +# add a commit which will later conflict with ones in +# branches B and C +sleep 2 +echo "version 1.1.2.2 of test file1" > file1 +cvs commit -m "CONFLICTING COMMIT" file1 + +# go back to the trunk and branch into B +cvs update -A +cvs tag -b B +cvs update -r B +echo "version 1.1.4.1 of test file1" > file1 +cvs commit -m "created branch B" file1 + +# add the commit we want to conflict +sleep 2 +echo "version 1.1.4.2 of test file1" > file1 +cvs commit -m "CONFLICTING COMMIT" file1 + +# go back to the trunk and branch into C +cvs update -A +cvs tag -b C +cvs update -r C +echo "version 1.1.6.1 of test file1" > file1 +cvs commit -m "created branch C" file1 + +# add yet another commit we want to conflict +sleep 2 +echo "version 1.1.6.2 of test file1" > file1 +cvs commit -m "CONFLICTING COMMIT" file1 + +# go back to the trunk +cvs update -A + +# and add yet another commit to conflict +sleep 2 +echo "version 1.2 of test file1" > file1 +cvs commit -m "CONFLICTING COMMIT" file1 + + +cd ../.. +rm -rf full_checkout + +# clean up the CVS repository bookkeeping dir +rm -rf cvs-repository/CVSROOT +