# # # add_dir "tests/importing_cvs_files_with_identical_logs2" # # add_dir "tests/importing_cvs_files_with_identical_logs2/cvs-repository" # # add_dir "tests/importing_cvs_files_with_identical_logs2/cvs-repository/test" # # add_file "tests/importing_cvs_files_with_identical_logs2/__driver__.lua" # content [066768db389d98a9dc4d55477d766f4d122959a4] # # add_file "tests/importing_cvs_files_with_identical_logs2/cvs-repository/test/foo,v" # content [d4b20ef9f8722ec561906d7c0f84ef845893c679] # # add_file "tests/importing_cvs_files_with_identical_logs2/makerepo.sh" # content [ba67fdc009d4341f656843f06e252b45bb5e7cfd] # # set "tests/importing_cvs_files_with_identical_logs2/makerepo.sh" # attr "mtn:execute" # value "true" # ============================================================ --- tests/importing_cvs_files_with_identical_logs2/__driver__.lua 066768db389d98a9dc4d55477d766f4d122959a4 +++ tests/importing_cvs_files_with_identical_logs2/__driver__.lua 066768db389d98a9dc4d55477d766f4d122959a4 @@ -0,0 +1,30 @@ + +mtn_setup() + +-- See makerepo.sh on how this repository was created. +check(get("cvs-repository")) + +-- Opposed to the first version of this test, here we have commits in +-- between the two commits with the same changelogs. This means, we +-- internally end up with a cycle consisting of multiple blobs. + +writefile("foo.0", "version 0 of test file foo\n") +writefile("foo.1", "version 1 of test file foo\n") +writefile("foo.2", "version 2 of test file foo\n") +writefile("foo.3", "version 3 of test file foo\n") +tsha0 = sha1("foo.0") +tsha1 = sha1("foo.1") +tsha2 = sha1("foo.2") +tsha3 = sha1("foo.3") + +-- import into monotone and check presence of files +check(mtn("--branch=testbranch", "cvs_import", "cvs-repository/test"), 0, false, false) +check(mtn("automate", "get_file", tsha0), 0, false) +check(mtn("automate", "get_file", tsha1), 0, false) +check(mtn("automate", "get_file", tsha2), 0, false) +check(mtn("automate", "get_file", tsha3), 0, false) + +-- also check that history is okay -- has a unique head, and it's the +-- right one. +check(mtn("checkout", "--branch=testbranch", "mtcodir"), 0, false, false) +check(samefile("foo.3", "mtcodir/foo")) ============================================================ --- tests/importing_cvs_files_with_identical_logs2/cvs-repository/test/foo,v d4b20ef9f8722ec561906d7c0f84ef845893c679 +++ tests/importing_cvs_files_with_identical_logs2/cvs-repository/test/foo,v d4b20ef9f8722ec561906d7c0f84ef845893c679 @@ -0,0 +1,128 @@ +head 1.7; +access; +symbols; +locks; strict; +comment @# @; + + +1.7 +date 2007.03.14.11.15.38; author markus; state Exp; +branches; +next 1.6; +commitid wvwSqYv4t1of23as; + +1.6 +date 2007.03.14.11.15.37; author markus; state Exp; +branches; +next 1.5; +commitid rkQ83Ep6STbf23as; + +1.5 +date 2007.03.14.11.15.36; author markus; state Exp; +branches; +next 1.4; +commitid qC94brPKTNQe23as; + +1.4 +date 2007.03.14.11.15.35; author markus; state Exp; +branches; +next 1.3; +commitid UK467bFFFlpe23as; + +1.3 +date 2007.03.14.11.15.34; author markus; state Exp; +branches; +next 1.2; +commitid QAXpf2URXkXd23as; + +1.2 +date 2007.03.14.11.15.33; author markus; state Exp; +branches; +next 1.1; +commitid Roy3NFph6yCd23as; + +1.1 +date 2007.03.14.11.15.32; author markus; state Exp; +branches; +next ; +commitid 0ycDH6lKeiwd23as; + + +desc +@@ + + +1.7 +log address@hidden 3 +@ +text address@hidden 3 of test file foo +@ + + +1.6 +log address@hidden same message +@ +text address@hidden 1 +a1 1 +version 2 of test file foo +@ + + +1.5 +log address@hidden 1d in between +@ +text address@hidden 1 +a1 1 +version 1d of test file foo +@ + + +1.4 +log address@hidden 1c in between +@ +text address@hidden 1 +a1 1 +version 1c of test file foo +@ + + +1.3 +log address@hidden 1b in between +@ +text address@hidden 1 +a1 1 +version 1b of test file foo +@ + + +1.2 +log address@hidden same message +@ +text address@hidden 1 +a1 1 +version 1 of test file foo +@ + + +1.1 +log address@hidden 0 +@ +text address@hidden 1 +a1 1 +version 0 of test file foo +@ + ============================================================ --- tests/importing_cvs_files_with_identical_logs2/makerepo.sh ba67fdc009d4341f656843f06e252b45bb5e7cfd +++ tests/importing_cvs_files_with_identical_logs2/makerepo.sh ba67fdc009d4341f656843f06e252b45bb5e7cfd @@ -0,0 +1,46 @@ +#!/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 + +# do some commits on file foo +echo "version 0 of test file foo" > test/foo +cvs add test/foo +cvs commit -m "commit 0" test/foo + +echo "version 1 of test file foo" > test/foo +cvs commit -m "commit same message" test/foo + +echo "version 1b of test file foo" > test/foo +cvs commit -m "commit 1b in between" test/foo + +echo "version 1c of test file foo" > test/foo +cvs commit -m "commit 1c in between" test/foo + +echo "version 1d of test file foo" > test/foo +cvs commit -m "commit 1d in between" test/foo + +echo "version 2 of test file foo" > test/foo +cvs commit -m "commit same message" test/foo + +echo "version 3 of test file foo" > test/foo +cvs commit -m "commit 3" test/foo + +cd .. +rm -rf full_checkout + +# clean up the CVS repository bookkeeping dir +rm -rf cvs-repository/CVSROOT