# # # add_dir "tests/importing_cvs_dryrun/cvs-repository" # # add_dir "tests/importing_cvs_dryrun/cvs-repository/test" # # add_file "tests/importing_cvs_dryrun/cvs-repository/test/foo,v" # content [7cbf72d445ae1a4163a72353c2a4d14824ddb2fb] # # add_file "tests/importing_cvs_dryrun/makerepo.sh" # content [ea1910481eda82366d08d195472c67391511fdce] # # patch "tests/importing_cvs_dryrun/__driver__.lua" # from [4d0f49a63ba3a6ad11ed41debc8d90933e94a9d5] # to [93b72b4261e8e883d9dfbf291aa8a3b9961435b5] # # set "tests/importing_cvs_dryrun/makerepo.sh" # attr "mtn:execute" # value "true" # ============================================================ --- tests/importing_cvs_dryrun/cvs-repository/test/foo,v 7cbf72d445ae1a4163a72353c2a4d14824ddb2fb +++ tests/importing_cvs_dryrun/cvs-repository/test/foo,v 7cbf72d445ae1a4163a72353c2a4d14824ddb2fb @@ -0,0 +1,77 @@ +head 1.4; +access; +symbols; +locks; strict; +comment @# @; + + +1.4 +date 2007.03.09.17.48.13; author markus; state Exp; +branches; +next 1.3; +commitid iiyWSTfQMIvTmr9s; + +1.3 +date 2007.03.09.17.48.12; author markus; state Exp; +branches; +next 1.2; +commitid iPnyv8txsg6Tmr9s; + +1.2 +date 2007.03.09.17.48.11; author markus; state Exp; +branches; +next 1.1; +commitid XyAQWJoKolDSmr9s; + +1.1 +date 2007.03.09.17.48.10; author markus; state Exp; +branches; +next ; +commitid QSc95jTLw9ySmr9s; + + +desc +@@ + + +1.4 +log address@hidden 3 +@ +text address@hidden 3 of test file foo +@ + + +1.3 +log address@hidden same message +@ +text address@hidden 1 +a1 1 +version 2 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_dryrun/makerepo.sh ea1910481eda82366d08d195472c67391511fdce +++ tests/importing_cvs_dryrun/makerepo.sh ea1910481eda82366d08d195472c67391511fdce @@ -0,0 +1,37 @@ +#!/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 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 ============================================================ --- tests/importing_cvs_dryrun/__driver__.lua 4d0f49a63ba3a6ad11ed41debc8d90933e94a9d5 +++ tests/importing_cvs_dryrun/__driver__.lua 93b72b4261e8e883d9dfbf291aa8a3b9961435b5 @@ -1,45 +1,26 @@ -include("/common/cvs.lua") mtn_setup() -writefile("importme.3", "version 3 of test file") +-- See makerepo.sh on how this repository was created. +check(get("cvs-repository")) +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") --- build the cvs repository - -cvs_setup() - --- check out the workspace and make some commits --- note that this has to use copy, rather than rename, to update --- the file in cvs. Apparently, cvs uses timestamps or something to track --- file modifications. -check(cvs("co", "."), 0, false, false) -mkdir("testdir") -writefile("testdir/importme", "version 0 of test file") -tsha0 = sha1("testdir/importme") -check(cvs("add", "testdir"), 0, false, false) -check(cvs("add", "testdir/importme"), 0, false, false) -check(cvs("commit", "-m", 'commit 0', "testdir/importme"), 0, false, false) -writefile("testdir/importme", "version 1 of test file") -tsha1 = sha1("testdir/importme") -check(cvs("commit", "-m", 'commit 1', "testdir/importme"), 0, false, false) -writefile("testdir/importme", "version 2 of test file") -tsha2 = sha1("testdir/importme") -check(cvs("commit", "-m", 'commit 2', "testdir/importme"), 0, false, false) -writefile("testdir/importme", "version 3 of test file") -tsha3 = sha1("testdir/importme") -check(cvs("commit", "-m", 'commit 3', "testdir/importme"), 0, false, false) - -- import into monotone using dryrun and check if the database has really -- not been touched -check(mtn("--dry-run", "--branch=testbranch", "cvs_import", cvsroot .. "/testdir"), 0, false, false) +check(mtn("--dry-run", "--branch=testbranch", "cvs_import", "cvs-repository/test"), 0, false, false) check(mtn("automate", "get_file", tsha0), 1, false, false) check(mtn("automate", "get_file", tsha1), 1, false, false) check(mtn("automate", "get_file", tsha2), 1, false, false) check(mtn("automate", "get_file", tsha3), 1, false, false) --- also check that history is okay -- has a unique head, and it's the --- right one. - +-- try to check out the testbranch, which should fail, too. check(mtn("checkout", "--branch=testbranch", "mtcodir"), 1, false, false)