# # # add_dir "tests/importing_cvs_cycle_splitter1" # # add_dir "tests/importing_cvs_cycle_splitter1/cvs-repository" # # add_dir "tests/importing_cvs_cycle_splitter1/cvs-repository/test" # # add_file "tests/importing_cvs_cycle_splitter1/__driver__.lua" # content [98c41642850525b6d2a8966060be65b49ad2ac68] # # add_file "tests/importing_cvs_cycle_splitter1/cvs-repository/test/bar,v" # content [9bdc5872113ad87011120a2384975e3155f75192] # # add_file "tests/importing_cvs_cycle_splitter1/cvs-repository/test/foo,v" # content [96520c5cd80f62c383e4683c44d62963de16ca4a] # # add_file "tests/importing_cvs_cycle_splitter1/makerepo.sh" # content [bfde1d1fa7c2f6cb9825ecbd92aed8eb25362c54] # # set "tests/importing_cvs_cycle_splitter1/makerepo.sh" # attr "mtn:execute" # value "true" # ============================================================ --- tests/importing_cvs_cycle_splitter1/__driver__.lua 98c41642850525b6d2a8966060be65b49ad2ac68 +++ tests/importing_cvs_cycle_splitter1/__driver__.lua 98c41642850525b6d2a8966060be65b49ad2ac68 @@ -0,0 +1,26 @@ + +mtn_setup() + +-- Test splitting a normal cycle: +-- +-- A -> B -> C +-- ^ | +-- | | +-- +---------+ +-- +-- As blob A has the largest gap, this cycle should be split into: +-- +-- A(1) -> B -> C -> A(2) + +-- 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) +check(samelines("stdout", {"blob A", "blob C", "blob B", "blob A"})) + ============================================================ --- tests/importing_cvs_cycle_splitter1/cvs-repository/test/bar,v 9bdc5872113ad87011120a2384975e3155f75192 +++ tests/importing_cvs_cycle_splitter1/cvs-repository/test/bar,v 9bdc5872113ad87011120a2384975e3155f75192 @@ -0,0 +1,77 @@ +head 1.4; +access; +symbols; +locks; strict; +comment @# @; + + +1.4 +date 2007.08.11.11.39.19; author markus; state Exp; +branches; +next 1.3; +commitid wctV8ddp6Y7rlkts; + +1.3 +date 2007.08.11.11.39.18; author markus; state Exp; +branches; +next 1.2; +commitid lkjfjlFj3m3rlkts; + +1.2 +date 2007.08.11.11.39.17; author markus; state Exp; +branches; +next 1.1; +commitid mnMQpnbr3DJqlkts; + +1.1 +date 2007.08.11.11.39.15; author markus; state Exp; +branches; +next ; +commitid BIo6UxgR1xTplkts; + + +desc +@@ + + +1.4 +log address@hidden A +@ +text address@hidden 1.4 of test file bar +@ + + +1.3 +log address@hidden C +@ +text address@hidden 1 +a1 1 +version 1.3 of test file bar +@ + + +1.2 +log address@hidden B +@ +text address@hidden 1 +a1 1 +version 1.2 of test file bar +@ + + +1.1 +log address@hidden import +@ +text address@hidden 1 +a1 1 +version 1.1 of test file bar +@ + ============================================================ --- tests/importing_cvs_cycle_splitter1/cvs-repository/test/foo,v 96520c5cd80f62c383e4683c44d62963de16ca4a +++ tests/importing_cvs_cycle_splitter1/cvs-repository/test/foo,v 96520c5cd80f62c383e4683c44d62963de16ca4a @@ -0,0 +1,77 @@ +head 1.4; +access; +symbols; +locks; strict; +comment @# @; + + +1.4 +date 2007.08.11.11.39.18; author markus; state Exp; +branches; +next 1.3; +commitid lkjfjlFj3m3rlkts; + +1.3 +date 2007.08.11.11.39.17; author markus; state Exp; +branches; +next 1.2; +commitid mnMQpnbr3DJqlkts; + +1.2 +date 2007.08.11.11.39.16; author markus; state Exp; +branches; +next 1.1; +commitid DxQVVIrydxbqlkts; + +1.1 +date 2007.08.11.11.39.15; author markus; state Exp; +branches; +next ; +commitid BIo6UxgR1xTplkts; + + +desc +@@ + + +1.4 +log address@hidden C +@ +text address@hidden 1.4 of test file foo +@ + + +1.3 +log address@hidden B +@ +text address@hidden 1 +a1 1 +version 1.3 of test file foo +@ + + +1.2 +log address@hidden A +@ +text address@hidden 1 +a1 1 +version 1.2 of test file foo +@ + + +1.1 +log address@hidden import +@ +text address@hidden 1 +a1 1 +version 1.1 of test file foo +@ + ============================================================ --- tests/importing_cvs_cycle_splitter1/makerepo.sh bfde1d1fa7c2f6cb9825ecbd92aed8eb25362c54 +++ tests/importing_cvs_cycle_splitter1/makerepo.sh bfde1d1fa7c2f6cb9825ecbd92aed8eb25362c54 @@ -0,0 +1,48 @@ +#!/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 + +# initiate the repository with two files +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 "initial import" test/foo test/bar + +# commit file foo of blob A +echo "version 1.2 of test file foo" > test/foo +cvs commit -m "blob A" test/foo + +# blob B +echo "version 1.3 of test file foo" > test/foo +echo "version 1.2 of test file bar" > test/bar +cvs commit -m "blob B" test/foo test/bar + +# blob C +echo "version 1.4 of test file foo" > test/foo +echo "version 1.3 of test file bar" > test/bar +cvs commit -m "blob C" test/foo test/bar + +# commit file bar of blob A, creates the dependency cycle +echo "version 1.4 of test file bar" > test/bar +cvs commit -m "blob A" test/bar + +cd .. +rm -rf full_checkout + +# clean up the CVS repository bookkeeping dir +rm -rf cvs-repository/CVSROOT +