# # # add_dir "tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository" # # add_dir "tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test" # # add_dir "tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/Attic" # # add_file "tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/Attic/file3,v" # content [66ace9c418c0d742641bfc24ae4266da3f1f1605] # # add_file "tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/changelog,v" # content [81622031bd9a17069991cc9945e7d457d66905dc] # # add_file "tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/file1,v" # content [29e0d8bc74bc5ac040ff8b179f4403dc65ce7164] # # add_file "tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/file2,v" # content [c7b9b25da60fb26234bcc31ef8685a3bcf662a29] # # add_file "tests/importing_cvs_branches_with_correct_ancestory_2/makerepo.sh" # content [3bde7361a7e6be4f7627749f27591cbded3e80be] # # patch "tests/importing_cvs_branches_with_correct_ancestory_2/__driver__.lua" # from [03bc1e4cf431c060c528c5f7d763982521e38fc0] # to [f237f0cd8bf7ff3b0e4c9a615a11b622ecc6db69] # # set "tests/importing_cvs_branches_with_correct_ancestory_2/makerepo.sh" # attr "mtn:execute" # value "true" # ============================================================ --- tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/Attic/file3,v 66ace9c418c0d742641bfc24ae4266da3f1f1605 +++ tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/Attic/file3,v 66ace9c418c0d742641bfc24ae4266da3f1f1605 @@ -0,0 +1,63 @@ +head 1.1; +access; +symbols + D:1.1.2.1.0.2 + C:1.1.0.2; +locks; strict; +comment @# @; + + +1.1 +date 2007.03.10.12.10.03; author markus; state dead; +branches + 1.1.2.1; +next ; +commitid LQlRD0MAMXhTsx9s; + +1.1.2.1 +date 2007.03.10.12.10.03; author markus; state Exp; +branches + 1.1.2.1.2.1; +next ; +commitid LQlRD0MAMXhTsx9s; + +1.1.2.1.2.1 +date 2007.03.10.12.10.04; author markus; state Exp; +branches; +next ; +commitid JwFdTHp8EAzTsx9s; + + +desc +@@ + + +1.1 +log address@hidden file3 was initially added on branch C. +@ +text +@@ + + +1.1.2.1 +log address@hidden on branch C +@ +text address@hidden 1 +version 1.1.2.1 of test file3 +@ + + +1.1.2.1.2.1 +log address@hidden on branch D +@ +text address@hidden 1 +a1 1 +version 1.1.2.1.2.1 of test file3 +@ + + ============================================================ --- tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/changelog,v 81622031bd9a17069991cc9945e7d457d66905dc +++ tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/changelog,v 81622031bd9a17069991cc9945e7d457d66905dc @@ -0,0 +1,113 @@ +head 1.3; +access; +symbols + D:1.2.2.1.4.1.0.2 + C:1.2.2.1.0.4 + B:1.2.2.1.0.2 + A:1.2.0.2; +locks; strict; +comment @# @; + + +1.3 +date 2007.03.10.12.10.06; author markus; state Exp; +branches; +next 1.2; +commitid ebGW0koTXumUsx9s; + +1.2 +date 2007.03.10.12.10.01; author markus; state Exp; +branches + 1.2.2.1; +next 1.1; +commitid DQfi38SuodxSsx9s; + +1.1 +date 2007.03.10.12.10.00; author markus; state Exp; +branches; +next ; +commitid ypY9fBLqgi5Ssx9s; + +1.2.2.1 +date 2007.03.10.12.10.02; author markus; state Exp; +branches + 1.2.2.1.4.1; +next ; +commitid ZhregeBAQcJSsx9s; + +1.2.2.1.4.1 +date 2007.03.10.12.10.03; author markus; state Exp; +branches + 1.2.2.1.4.1.2.1; +next ; +commitid LQlRD0MAMXhTsx9s; + +1.2.2.1.4.1.2.1 +date 2007.03.10.12.10.04; author markus; state Exp; +branches; +next ; +commitid JwFdTHp8EAzTsx9s; + + +desc +@@ + + +1.3 +log address@hidden on mainline after branch +@ +text address@hidden changelog entry +second changelog entry +third changelog -not on branch- +@ + + +1.2 +log address@hidden commit +@ +text address@hidden 1 +@ + + +1.2.2.1 +log address@hidden on branch A +@ +text address@hidden 1 +third changelog -on branch A- +@ + + +1.2.2.1.4.1 +log address@hidden on branch C +@ +text address@hidden 1 +fourth changelog -on branch C- +@ + + +1.2.2.1.4.1.2.1 +log address@hidden on branch D +@ +text address@hidden 1 +fifth changelog -on branch D- +@ + + +1.1 +log address@hidden import +@ +text address@hidden 1 +@ + ============================================================ --- tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/file1,v 29e0d8bc74bc5ac040ff8b179f4403dc65ce7164 +++ tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/file1,v 29e0d8bc74bc5ac040ff8b179f4403dc65ce7164 @@ -0,0 +1,82 @@ +head 1.3; +access; +symbols + D:1.2.0.8 + C:1.2.0.6 + B:1.2.0.4 + A:1.2.0.2; +locks; strict; +comment @# @; + + +1.3 +date 2007.03.10.12.10.06; author markus; state Exp; +branches; +next 1.2; +commitid ebGW0koTXumUsx9s; + +1.2 +date 2007.03.10.12.10.01; author markus; state Exp; +branches + 1.2.8.1; +next 1.1; +commitid DQfi38SuodxSsx9s; + +1.1 +date 2007.03.10.12.10.00; author markus; state Exp; +branches; +next ; +commitid ypY9fBLqgi5Ssx9s; + +1.2.8.1 +date 2007.03.10.12.10.04; author markus; state Exp; +branches; +next ; +commitid JwFdTHp8EAzTsx9s; + + +desc +@@ + + +1.3 +log address@hidden on mainline after branch +@ +text address@hidden 1.3 of test file1 +@ + + +1.2 +log address@hidden commit +@ +text address@hidden 1 +a1 1 +version 1.2 of test file1 +@ + + +1.2.8.1 +log address@hidden on branch D +@ +text address@hidden 1 +a1 1 +version 1.2.8.1 of test file1 +@ + + +1.1 +log address@hidden import +@ +text address@hidden 1 +a1 1 +version 1.1 of test file1 +@ + ============================================================ --- tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/file2,v c7b9b25da60fb26234bcc31ef8685a3bcf662a29 +++ tests/importing_cvs_branches_with_correct_ancestory_2/cvs-repository/test/file2,v c7b9b25da60fb26234bcc31ef8685a3bcf662a29 @@ -0,0 +1,67 @@ +head 1.1; +access; +symbols + D:1.1.2.1.0.6 + C:1.1.2.1.0.4 + B:1.1.2.1.0.2 + A:1.1.0.2; +locks; strict; +comment @# @; + + +1.1 +date 2007.03.10.12.10.00; author markus; state Exp; +branches + 1.1.2.1; +next ; +commitid ypY9fBLqgi5Ssx9s; + +1.1.2.1 +date 2007.03.10.12.10.02; author markus; state Exp; +branches + 1.1.2.1.6.1; +next ; +commitid ZhregeBAQcJSsx9s; + +1.1.2.1.6.1 +date 2007.03.10.12.10.04; author markus; state Exp; +branches; +next ; +commitid JwFdTHp8EAzTsx9s; + + +desc +@@ + + +1.1 +log address@hidden import +@ +text address@hidden 1.1 of test file2 +@ + + +1.1.2.1 +log address@hidden on branch A +@ +text address@hidden 1 +a1 1 +version 1.1.2.1 of test file2 +@ + + +1.1.2.1.6.1 +log address@hidden on branch D +@ +text address@hidden 1 +a1 1 +version 1.1.2.1.6.1 of test file2 +@ + + ============================================================ --- tests/importing_cvs_branches_with_correct_ancestory_2/makerepo.sh 3bde7361a7e6be4f7627749f27591cbded3e80be +++ tests/importing_cvs_branches_with_correct_ancestory_2/makerepo.sh 3bde7361a7e6be4f7627749f27591cbded3e80be @@ -0,0 +1,77 @@ +#!/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 some files +echo "version 1.1 of test file1" > file1 +echo "version 1.1 of test file2" > file2 +echo "first changelog entry" > changelog +cvs add file1 file2 changelog +cvs commit -m "initial import" file1 file2 changelog + +# commit first changes +echo "version 1.2 of test file1" > file1 +echo "second changelog entry" >> changelog +cvs commit -m "first commit" file1 changelog + +# now we create a branch A +cvs tag -b A +cvs update -r A + +# alter the files on branch A +echo "version 1.1.2.1 of test file2" > file2 +echo "third changelog -on branch A-" >> changelog +cvs commit -m "commit on branch A" file2 changelog + +# branch again into B +cvs tag -b B +cvs update -r B + +# branch B is left untouched + +# go back to A and branch into C +cvs update -r A -A +cvs tag -b C +cvs update -r C + +# add a file3 +echo "version 1.1.2.1 of test file3" > file3 +echo "fourth changelog -on branch C-" >> changelog +cvs add file3 +cvs commit -m "commit on branch C" file3 changelog + +# branch into D +cvs tag -b D +cvs update -r D +echo "version 1.2.8.1 of test file1" > file1 +echo "version 1.1.2.1.6.1 of test file2" > file2 +echo "version 1.1.2.1.2.1 of test file3" > file3 +echo "fifth changelog -on branch D-" >> changelog +cvs commit -m "commit on branch D" file1 file2 file3 changelog + +# and create some mainline changes after the branch +cvs update -A +echo "version 1.3 of test file1" > file1 +echo "third changelog -not on branch-" >> changelog +cvs commit -m "commit on mainline after branch" file1 changelog + +cd ../.. +rm -rf full_checkout + +# clean up the CVS repository bookkeeping dir +rm -rf cvs-repository/CVSROOT ============================================================ --- tests/importing_cvs_branches_with_correct_ancestory_2/__driver__.lua 03bc1e4cf431c060c528c5f7d763982521e38fc0 +++ tests/importing_cvs_branches_with_correct_ancestory_2/__driver__.lua f237f0cd8bf7ff3b0e4c9a615a11b622ecc6db69 @@ -1,6 +1,10 @@ -include("common/cvs.lua") + mtn_setup() + +-- See makerepo.sh on how this repository was created. +check(get("cvs-repository")) + -- -- Branch layout overview: -- @@ -16,90 +20,29 @@ mtn_setup() -- touch any other file. D then updates all files. No commits on branch B, it -- remains empty. -writefile("file1.0", "version 0 of test file1") -writefile("file1.1", "version 1 of test file1") -writefile("file1.2", "version 2 of test file1") -writefile("file1.3", "version 3 of test file1") -writefile("file2.0", "version 0 of test file2") -writefile("file2.1", "version 1 of test file2") -writefile("file2.2", "version 2 of test file2") -writefile("file3.0", "version 0 of test file3") -writefile("file3.1", "version 1 of test file3") -writefile("changelog.0", "first changelog entry") -writefile("changelog.1", "second changelog\n\n"..readfile("changelog.0")) -writefile("changelog.2", "third changelog -not on branch-\n\n"..readfile("changelog.1")) -writefile("changelog.3", "third changelog -on branch A-\n\n"..readfile("changelog.1")) -writefile("changelog.4", "fourth changelog -on branch C-\n\n"..readfile("changelog.3")) -writefile("changelog.5", "fifth changelog -on branch D-\n\n"..readfile("changelog.4")) +writefile("file1-1.1", "version 1.1 of test file1\n") +writefile("file1-1.2", "version 1.2 of test file1\n") +writefile("file1-1.3", "version 1.3 of test file1\n") +writefile("file1-1.2.8.1", "version 1.2.8.1 of test file1\n") +writefile("file2-1.1", "version 1.1 of test file2\n") +writefile("file2-1.1.2.1", "version 1.1.2.1 of test file2\n") +writefile("file2-1.1.2.1.6.1", "version 1.1.2.1.6.1 of test file2\n") +writefile("file3-1.1.2.1", "version 1.1.2.1 of test file3\n") +writefile("file3-1.1.2.1.2.1", "version 1.1.2.1.2.1 of test file3\n") --- build the cvs repository +writefile("changelog.1", "first changelog entry\n") +writefile("changelog.2", readfile("changelog.1").."second changelog entry\n") +writefile("changelog.3", readfile("changelog.2").."third changelog -not on branch-\n") +writefile("changelog.A.3", readfile("changelog.2").."third changelog -on branch A-\n") +writefile("changelog.C.4", readfile("changelog.A.3").."fourth changelog -on branch C-\n") +writefile("changelog.D.5", readfile("changelog.C.4").."fifth changelog -on branch D-\n") -cvs_setup() - --- checkout the empty repository and commit some files - -check(cvs("co", "."), 0, false, false) -mkdir("testdir") -copy("file1.0", "testdir/file1") -copy("file2.0", "testdir/file2") -copy("changelog.0", "testdir/changelog") -check(cvs("add", "testdir"), 0, false, false) -check(cvs("add", "testdir/file1"), 0, false, false) -check(cvs("add", "testdir/file2"), 0, false, false) -check(cvs("add", "testdir/changelog"), 0, false, false) -check(cvs("commit", "-m", 'initial import', "testdir/file1", "testdir/file2", "testdir/changelog"), 0, false, false) - --- commit first changes -copy("file1.1", "testdir/file1") -copy("changelog.1", "testdir/changelog") -check(cvs("commit", "-m", 'first commit', "testdir/file1", "testdir/changelog"), 0, false, false) - --- now we create a branch A -check(indir("testdir", cvs("tag", "-b", "A")), 0, false, false) -check(indir("testdir", cvs("up", "-r", "A")), 0, false, false) - --- alter the files on branch A -copy("file2.1", "testdir/file2") -copy("changelog.3", "testdir/changelog") -check(cvs("commit", "-m", 'commit on branch A', "testdir/file2", "testdir/changelog"), 0, false, false) - --- branch again into B -check(indir("testdir", cvs("tag", "-b", "B")), 0, false, false) -check(indir("testdir", cvs("up", "-r", "B")), 0, false, false) --- branch B is left untouched - --- go back to A and branch into C -check(cvs("up", "-r", "A", "-A"), 0, false, false) -check(indir("testdir", cvs("tag", "-b", "C")), 0, false, false) -check(indir("testdir", cvs("up", "-r", "C")), 0, false, false) - --- add a file3 -copy("file3.0", "testdir/file3") -copy("changelog.4", "testdir/changelog") -check(indir("testdir", cvs("add", "file3")), 0, false, false) -check(indir("testdir", cvs("commit", "-m", 'commit on branch C', "file3", "changelog")), 0, false, false) - --- branch into D -check(indir("testdir", cvs("tag", "-b", "D")), 0, false, false) -check(indir("testdir", cvs("up", "-r", "D")), 0, false, false) -copy("file1.3", "testdir/file1") -copy("file2.2", "testdir/file2") -copy("file3.1", "testdir/file3") -copy("changelog.5", "testdir/changelog") -check(indir("testdir", cvs("commit", "-m", 'commit on branch D', "file1", "file2", "file3", "changelog")), 0, false, false) - --- and create some mainline changes after the branch -check(cvs("up", "-A"), 0, false, false) -copy("file1.2", "testdir/file1") -copy("changelog.2", "testdir/changelog") -check(cvs("commit", "-m", 'commit on mainline after branch', "testdir/file1", "testdir/changelog"), 0, false, false) - -- import into monotone and check presence of files -check(mtn("--branch=test", "cvs_import", cvsroot.."/testdir"), 0, false, false) +check(mtn("--branch=test", "cvs_import", "cvs-repository/test"), 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.C", "test.D"})) +check(samelines("stdout", {"test", "test.A", "test.B", "test.C", "test.D"})) -- checkout the imported repository into maindir and branchdir check(mtn("checkout", "--branch=test", "maindir"), 0, false, false) @@ -108,30 +51,29 @@ check(mtn("checkout", "--branch=test.D", check(mtn("checkout", "--branch=test.D", "branchD"), 0, false, false) -- check for correctness of the files in the main tree -check(samefile("file1.2", "maindir/file1")) -check(samefile("file2.0", "maindir/file2")) -check(samefile("changelog.2", "maindir/changelog")) +check(samefile("file1-1.3", "maindir/file1")) +check(samefile("file2-1.1", "maindir/file2")) +check(samefile("changelog.3", "maindir/changelog")) -- check for correctness of the files in branch A -check(samefile("file1.1", "branchA/file1")) -check(samefile("file2.1", "branchA/file2")) -check(samefile("changelog.3", "branchA/changelog")) +check(samefile("file1-1.2", "branchA/file1")) +check(samefile("file2-1.1.2.1", "branchA/file2")) +check(samefile("changelog.A.3", "branchA/changelog")) -- check for correctness of the files in branch C -check(samefile("file1.1", "branchC/file1")) -check(samefile("file2.1", "branchC/file2")) -check(samefile("file3.0", "branchC/file3")) -check(samefile("changelog.4", "branchC/changelog")) +check(samefile("file1-1.2", "branchC/file1")) +check(samefile("file2-1.1.2.1", "branchC/file2")) +check(samefile("file3-1.1.2.1", "branchC/file3")) +check(samefile("changelog.C.4", "branchC/changelog")) -- check for correctness of the files in branch D -check(samefile("file1.3", "branchD/file1")) -check(samefile("file2.2", "branchD/file2")) -check(samefile("file3.1", "branchD/file3")) -check(samefile("changelog.5", "branchD/changelog")) +check(samefile("file1-1.2.8.1", "branchD/file1")) +check(samefile("file2-1.1.2.1.6.1", "branchD/file2")) +check(samefile("file3-1.1.2.1.2.1", "branchD/file3")) +check(samefile("changelog.D.5", "branchD/changelog")) -- check the log of branch A for correctness check(indir("branchA", mtn("log")), 0, true, false) -check(grep("beginning of branch", "stdout"), 1, false, false) check(grep("initial import", "stdout"), 0, false, false) check(grep("first commit", "stdout"), 0, false, false) check(grep("commit on branch A", "stdout"), 0, false, false) @@ -141,7 +83,6 @@ check(indir("branchC", mtn("log")), 0, t -- check the log of branch C for correctness check(indir("branchC", mtn("log")), 0, true, false) -check(grep("beginning of branch", "stdout"), 1, false, false) check(grep("initial import", "stdout"), 0, false, false) check(grep("first commit", "stdout"), 0, false, false) check(grep("commit on branch A", "stdout"), 0, false, false) @@ -151,7 +92,6 @@ check(indir("branchD", mtn("log")), 0, t -- check the log of branch D for correctness check(indir("branchD", mtn("log")), 0, true, false) -check(grep("beginning of branch", "stdout"), 1, false, false) check(grep("initial import", "stdout"), 0, false, false) check(grep("first commit", "stdout"), 0, false, false) check(grep("commit on branch A", "stdout"), 0, false, false)