# # # add_dir "tests/importing_cvs_timing_check" # # add_dir "tests/importing_cvs_timing_check/cvs-repository" # # add_dir "tests/importing_cvs_timing_check/cvs-repository/test" # # add_file "tests/importing_cvs_timing_check/__driver__.lua" # content [56d92bd3cfbac2dd8d88bbc9b762c6e5ae914602] # # add_file "tests/importing_cvs_timing_check/cvs-repository/test/bar,v" # content [d79bc1957684541ee365461fdf05fb90d30ac587] # # add_file "tests/importing_cvs_timing_check/cvs-repository/test/foo,v" # content [845eb01c04c2549fec3e704700d42960e1cbd382] # # add_file "tests/importing_cvs_timing_check/makerepo.sh" # content [792ce4c22b226c0bdea789992fbc96796c4aaef1] # # set "tests/importing_cvs_timing_check/makerepo.sh" # attr "mtn:execute" # value "true" # ============================================================ --- tests/importing_cvs_timing_check/__driver__.lua 56d92bd3cfbac2dd8d88bbc9b762c6e5ae914602 +++ tests/importing_cvs_timing_check/__driver__.lua 56d92bd3cfbac2dd8d88bbc9b762c6e5ae914602 @@ -0,0 +1,33 @@ + +mtn_setup() + +-- This test checks if the blobs are imported in the correct order (after +-- having toposorted them). Importing the repository gives the following +-- blob graph: +-- +-- A +-- / \ +-- B C +-- | | +-- E D +-- \ / +-- F +-- +-- The correct import order should be: A B C D E F, but a topological +-- sort (i.e. reversed post-ordering of a depth first search) returns +-- either A B E C D F or A C D B E F. + + +-- See makerepo.sh on how this repository was created. +check(get("cvs-repository")) + +-- import into monotone +check(mtn("--branch=testbranch", "cvs_import", "cvs-repository/test"), 0, false, false) + +-- check for correct ordering of the commits +check(mtn("checkout", "--branch=testbranch", "mtcodir"), 0, false, false) +check(indir("mtcodir", mtn("log", "--no-graph", "--no-files")), 0, true, false) +check(grep("blob", "stdout"), 0, true, false) +xfail(samelines("stdout", {"blob F", "blob E", "blob D", + "blob C", "blob B", "blob A"})) + ============================================================ --- tests/importing_cvs_timing_check/cvs-repository/test/bar,v d79bc1957684541ee365461fdf05fb90d30ac587 +++ tests/importing_cvs_timing_check/cvs-repository/test/bar,v d79bc1957684541ee365461fdf05fb90d30ac587 @@ -0,0 +1,77 @@ +head 1.4; +access; +symbols; +locks; strict; +comment @# @; + + +1.4 +date 2007.08.11.10.37.40; author markus; state Exp; +branches; +next 1.3; +commitid QuORtiiv7H3i0kts; + +1.3 +date 2007.08.11.10.37.28; author markus; state Exp; +branches; +next 1.2; +commitid yHaH8SEu11Dd0kts; + +1.2 +date 2007.08.11.10.37.22; author markus; state Exp; +branches; +next 1.1; +commitid QoacUnbGy0Cb0kts; + +1.1 +date 2007.08.11.10.37.11; author markus; state Exp; +branches; +next ; +commitid 5tM66v499rG70kts; + + +desc +@@ + + +1.4 +log address@hidden F +@ +text address@hidden 1.4 of test file bar +@ + + +1.3 +log address@hidden D +@ +text address@hidden 1 +a1 1 +version 1.3 of test file bar +@ + + +1.2 +log address@hidden C +@ +text address@hidden 1 +a1 1 +version 1.2 of test file bar +@ + + +1.1 +log address@hidden A +@ +text address@hidden 1 +a1 1 +version 1.1 of test file bar +@ + ============================================================ --- tests/importing_cvs_timing_check/cvs-repository/test/foo,v 845eb01c04c2549fec3e704700d42960e1cbd382 +++ tests/importing_cvs_timing_check/cvs-repository/test/foo,v 845eb01c04c2549fec3e704700d42960e1cbd382 @@ -0,0 +1,77 @@ +head 1.4; +access; +symbols; +locks; strict; +comment @# @; + + +1.4 +date 2007.08.11.10.37.40; author markus; state Exp; +branches; +next 1.3; +commitid QuORtiiv7H3i0kts; + +1.3 +date 2007.08.11.10.37.34; author markus; state Exp; +branches; +next 1.2; +commitid tTntTfQm7mPf0kts; + +1.2 +date 2007.08.11.10.37.17; author markus; state Exp; +branches; +next 1.1; +commitid 3Fbw9iTasnO90kts; + +1.1 +date 2007.08.11.10.37.11; author markus; state Exp; +branches; +next ; +commitid 5tM66v499rG70kts; + + +desc +@@ + + +1.4 +log address@hidden F +@ +text address@hidden 1.4 of test file foo +@ + + +1.3 +log address@hidden E +@ +text address@hidden 1 +a1 1 +version 1.3 of test file foo +@ + + +1.2 +log address@hidden B +@ +text address@hidden 1 +a1 1 +version 1.2 of test file foo +@ + + +1.1 +log address@hidden A +@ +text address@hidden 1 +a1 1 +version 1.1 of test file foo +@ + ============================================================ --- tests/importing_cvs_timing_check/makerepo.sh 792ce4c22b226c0bdea789992fbc96796c4aaef1 +++ tests/importing_cvs_timing_check/makerepo.sh 792ce4c22b226c0bdea789992fbc96796c4aaef1 @@ -0,0 +1,63 @@ +#!/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 + +# blob A +echo "version 1.1 of test file foo" > test/foo +echo "version 1.1 of test file bar" > test/bar +cvs add test/foo test/bar +cvs commit -m "blob A" test/foo test/bar + +# Because timing *is* important for this test, we make sure the timestamps +# in the repository are actually different enough. +sleep 5 + +# blob B +echo "version 1.2 of test file foo" > test/foo +cvs commit -m "blob B" test/foo + +sleep 5 + +# blob C +echo "version 1.2 of test file bar" > test/bar +cvs commit -m "blob C" test/bar + +sleep 5 + +# blob D +echo "version 1.3 of test file bar" > test/bar +cvs commit -m "blob D" test/bar + +sleep 5 + +# blob E +echo "version 1.3 of test file foo" > test/foo +cvs commit -m "blob E" test/foo + +sleep 5 + +# blob F +echo "version 1.4 of test file foo" > test/foo +echo "version 1.4 of test file bar" > test/bar +cvs commit -m "blob F" test/foo test/bar + +cd .. +rm -rf full_checkout + +# clean up the CVS repository bookkeeping dir +rm -rf cvs-repository/CVSROOT +