# # # add_dir "tests/importing_cvs_branch_from_empty_branch/cvs-repository" # # add_dir "tests/importing_cvs_branch_from_empty_branch/cvs-repository/test" # # add_file "tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileA,v" # content [54d08b98e5c0403fddf10994b44608e7f35dd3ba] # # add_file "tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileB,v" # content [77be9d37c4ffc1f8a01bbe83ccf4fd28ec9efff0] # # add_file "tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileC,v" # content [2bf16bf33e5f11f692c2eade24460dae2285a904] # # add_file "tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileD,v" # content [0bd72cbf855b2b2191ea9ac7a9122be851d3873d] # # add_file "tests/importing_cvs_branch_from_empty_branch/makerepo.sh" # content [9f1b88c89e926f577d72bdf01a327f19017c227c] # # patch "tests/importing_cvs_branch_from_empty_branch/__driver__.lua" # from [a4fe9cd208d25eeffdccfa9f0f2dff4dcf71e261] # to [9dbe8d21669bf06805fd0c701dccbfc5a60b9d43] # # set "tests/importing_cvs_branch_from_empty_branch/makerepo.sh" # attr "mtn:execute" # value "true" # ============================================================ --- tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileA,v 54d08b98e5c0403fddf10994b44608e7f35dd3ba +++ tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileA,v 54d08b98e5c0403fddf10994b44608e7f35dd3ba @@ -0,0 +1,29 @@ +head 1.1; +access; +symbols + X:1.1 + B:1.1.0.6 + A2:1.1.0.4 + A1:1.1.0.2; +locks; strict; +comment @# @; + + +1.1 +date 2007.03.10.12.21.49; author markus; state Exp; +branches; +next ; +commitid RijuhkU04dCVwx9s; + + +desc +@@ + + +1.1 +log address@hidden versions +@ +text address@hidden +@ ============================================================ --- tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileB,v 77be9d37c4ffc1f8a01bbe83ccf4fd28ec9efff0 +++ tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileB,v 77be9d37c4ffc1f8a01bbe83ccf4fd28ec9efff0 @@ -0,0 +1,48 @@ +head 1.1; +access; +symbols + X:1.1.2.1 + B:1.1.2.1.0.2 + A2:1.1.0.4 + A1:1.1.0.2; +locks; strict; +comment @# @; + + +1.1 +date 2007.03.10.12.21.49; author markus; state Exp; +branches + 1.1.2.1; +next ; +commitid RijuhkU04dCVwx9s; + +1.1.2.1 +date 2007.03.10.12.21.52; author markus; state Exp; +branches; +next ; +commitid HlmjCzXUytyWwx9s; + + +desc +@@ + + +1.1 +log address@hidden versions +@ +text address@hidden +@ + + +1.1.2.1 +log address@hidden 1.1.2.1 of fileB +@ +text address@hidden 1 +a1 1 +1.1.2.1 +@ + ============================================================ --- tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileC,v 2bf16bf33e5f11f692c2eade24460dae2285a904 +++ tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileC,v 2bf16bf33e5f11f692c2eade24460dae2285a904 @@ -0,0 +1,48 @@ +head 1.1; +access; +symbols + X:1.1.6.1 + B:1.1.0.6 + A2:1.1.0.4 + A1:1.1.0.2; +locks; strict; +comment @# @; + + +1.1 +date 2007.03.10.12.21.49; author markus; state Exp; +branches + 1.1.6.1; +next ; +commitid RijuhkU04dCVwx9s; + +1.1.6.1 +date 2007.03.10.12.21.53; author markus; state Exp; +branches; +next ; +commitid gRWRxNdCtHLWwx9s; + + +desc +@@ + + +1.1 +log address@hidden versions +@ +text address@hidden +@ + + +1.1.6.1 +log address@hidden 1.1.6.1 of fileC +@ +text address@hidden 1 +a1 1 +1.1.6.1 +@ + ============================================================ --- tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileD,v 0bd72cbf855b2b2191ea9ac7a9122be851d3873d +++ tests/importing_cvs_branch_from_empty_branch/cvs-repository/test/fileD,v 0bd72cbf855b2b2191ea9ac7a9122be851d3873d @@ -0,0 +1,47 @@ +head 1.2; +access; +symbols + X:1.1 + B:1.1.0.4 + A2:1.2.0.2 + A1:1.1.0.2; +locks; strict; +comment @# @; + + +1.2 +date 2007.03.10.12.21.50; author markus; state Exp; +branches; +next 1.1; +commitid q9bFcDfhoTIVwx9s; + +1.1 +date 2007.03.10.12.21.49; author markus; state Exp; +branches; +next ; +commitid RijuhkU04dCVwx9s; + + +desc +@@ + + +1.2 +log address@hidden 1.2 of fileD +@ +text address@hidden +@ + + +1.1 +log address@hidden versions +@ +text address@hidden 1 +a1 1 +1.1 +@ + ============================================================ --- tests/importing_cvs_branch_from_empty_branch/makerepo.sh 9f1b88c89e926f577d72bdf01a327f19017c227c +++ tests/importing_cvs_branch_from_empty_branch/makerepo.sh 9f1b88c89e926f577d72bdf01a327f19017c227c @@ -0,0 +1,57 @@ +#!/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 +cvs commit -m "Add test dir" + +# start with four initial files +cd test +echo "1.1" > fileA +echo "1.1" > fileB +echo "1.1" > fileC +echo "1.1" > fileD +cvs add fileA fileB fileC fileD +cvs commit -m "initial versions" + +# start branch A1 from here +cvs tag -b A1 + +# some changes (we are still on HEAD) +echo "1.2" > fileD +cvs commit -m "revision 1.2 of fileD" + +# start branch A2 from here +cvs tag -b A2 + +# switch to branch A1 and do a commit there +cvs update -r A1 +echo "1.1.2.1" > fileB +cvs commit -m "revision 1.1.2.1 of fileB" + +# create branch "B" and switch to that branch +cvs tag -b B +cvs update -r B +echo "1.1.6.1" > fileC +cvs commit -m "revision 1.1.6.1 of fileC" + +# tag this with X +cvs tag X + +cd ../.. +rm -rf full_checkout + +# clean up the CVS repository bookkeeping dir +rm -rf cvs-repository/CVSROOT ============================================================ --- tests/importing_cvs_branch_from_empty_branch/__driver__.lua a4fe9cd208d25eeffdccfa9f0f2dff4dcf71e261 +++ tests/importing_cvs_branch_from_empty_branch/__driver__.lua 9dbe8d21669bf06805fd0c701dccbfc5a60b9d43 @@ -1,8 +1,10 @@ -include("/common/cvs.lua") mtn_setup() -cvs_setup() + +-- See makerepo.sh on how this repository was created. +check(get("cvs-repository")) + -- A test case from Michael Haggerty, author of cvs2svn -- http://cvs2svn.tigris.org/servlets/ReadMsg?list=dev&msgNo=1878 -- @@ -10,62 +12,23 @@ cvs_setup() -- adoption for monotone automatically checks the result, but is -- otherwise equivalent. -check(cvs("co", "."), 0, false, false) -mkdir("testdir") -check(cvs("add", "testdir"), 0, false, false) -check(cvs("commit", "-m", "add dir"), 0, false, false) -writefile("testdir/fileA", "1.1") -check(cvs("add", "testdir/fileA"), 0, false, false) - -writefile("testdir/fileB", "1.1") -check(cvs("add", "testdir/fileB"), 0, false, false) - -writefile("testdir/fileC", "1.1") -check(cvs("add", "testdir/fileC"), 0, false, false) - -writefile("testdir/fileD", "1.1") -check(cvs("add", "testdir/fileD"), 0, false, false) - -check(cvs("commit", "-m", "initial versions"), 0, false, false) - -check(cvs("tag", "-b", "A1"), 0, false, false) - -writefile("testdir/fileD", "1.2") -check(cvs("commit", "-m", "revision 1.2 of fileD"), 0, false, false) - -check(cvs("tag", "-b", "A2"), 0, false, false) - --- switch to branch "A1" -check(cvs("update", "-r", "A1"), 0, false, false) - -writefile("testdir/fileB", "1.1.2.1") -check(cvs("commit", "-m", "revision 1.1.2.1 of fileB"), 0, false, false) - --- create branch "B" and switch to branch: -check(cvs("tag", "-b", "B"), 0, false, false) -check(cvs("update", "-r", "B"), 0, false, false) - -writefile("testdir/fileC", "1.1.6.1") -check(cvs("commit", "-m", "revision 1.1.6.1 of fileC"), 0, false, false) - -check(cvs("tag", "X"), 0, false, false) - -- import and check -check(mtn("--branch=test", "cvs_import", cvsroot.."/testdir"), 0, false, false) +check(mtn("--branch=test", "cvs_import", "cvs-repository/test"), 0, false, false) check(mtn("list", "branches"), 0, true, false) -check(samelines("stdout", {"test", "test.A1", "test.B"})) +check(samelines("stdout", {"test", "test.A1", "test.A2", "test.B"})) check(mtn("checkout", "-b", "test.A1", "mtnco"), 0, false, false) check(indir("mtnco", mtn("list", "known")), 0, true, false) check(samelines("stdout", {"fileA", "fileB", "fileC", "fileD"})) remove("mtnco") +-- checkout tag X and check its contents check(mtn("checkout", "-r", "X", "mtnco"), 0, false, false) check(indir("mtnco", mtn("list", "known")), 0, true, false) check(samelines("stdout", {"fileA", "fileB", "fileC", "fileD"})) +check(samelines("mtnco/fileA", {"1.1"})) +check(samelines("mtnco/fileB", {"1.1.2.1"})) +check(samelines("mtnco/fileC", {"1.1.6.1"})) +check(samelines("mtnco/fileD", {"1.1"})) -check(samefile("mtnco/fileA", "testdir/fileA")) -check(samefile("mtnco/fileB", "testdir/fileB")) -check(samefile("mtnco/fileC", "testdir/fileC")) -check(samefile("mtnco/fileD", "testdir/fileD"))