# # # add_dir "tests/importing_cvs_branches4" # # add_dir "tests/importing_cvs_branches4/cvs-repository" # # add_dir "tests/importing_cvs_branches4/cvs-repository/test" # # add_file "tests/importing_cvs_branches4/__driver__.lua" # content [e1c22ea7eb81e795c01e4e456185cc7bab2a837b] # # add_file "tests/importing_cvs_branches4/cvs-repository/test/file1,v" # content [a503a0993e33ed98011760a13f149b779553cd3b] # # add_file "tests/importing_cvs_branches4/cvs-repository/test/file2,v" # content [3a080c2f4911fdf8a1624823878d036b1a8642d2] # # add_file "tests/importing_cvs_branches4/makerepo.sh" # content [8a68a1be17de13d40647c6eeb872f0b2b3171637] # # patch "tests/importing_cvs_branches3/__driver__.lua" # from [e1c22ea7eb81e795c01e4e456185cc7bab2a837b] # to [7fbcf69fd29f27c255e13356d68acbcb78a6852c] # # set "tests/importing_cvs_branches4/makerepo.sh" # attr "mtn:execute" # value "true" # ============================================================ --- tests/importing_cvs_branches4/__driver__.lua e1c22ea7eb81e795c01e4e456185cc7bab2a837b +++ tests/importing_cvs_branches4/__driver__.lua e1c22ea7eb81e795c01e4e456185cc7bab2a837b @@ -0,0 +1,51 @@ + +mtn_setup() + + +-- See makerepo.sh on how this repository was created. +check(get("cvs-repository")) + +-- +-- Branch layout overview: +-- +-- Root +-- / \ +-- A B +-- +-- Root contains file1 and file2. Both files get a commit, file1 in branch +-- A, file2 in branch B. Both commits have the same commit message and +-- author. + +writefile("file1-1.1", "version 1.1 of test file1\n") +writefile("file1-1.1.4.1", "version 1.1.4.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") + +-- import into monotone and check presence of files +xfail(mtn("--branch=test", "cvs_import", "cvs-repository/test"), 0, false, false) + +-- We currently don't handle blobs, which seem to belong to two different +-- branches. See the branch_sanitizer. + +-- check if all non-empty branches were imported +check(mtn("list", "branches"), 0, true, false) +check(samelines("stdout", {"test", "test.A", "test.B"})) + +-- checkout the imported repository into maindir and branchdir +check(mtn("checkout", "--branch=test", "maindir"), 0, false, false) +check(mtn("checkout", "--branch=test.A", "branchA"), 0, false, false) +check(mtn("checkout", "--branch=test.B", "branchB"), 0, false, false) + +-- check for correctness of the files in the main tree +check(samefile("file1-1.1", "maindir/file1")) +check(samefile("file2-1.1", "maindir/file2")) + +-- check for correctness of the files in branch A +check(samefile("file1-1.1", "branchA/file1")) +check(samefile("file2-1.1.2.1", "branchA/file2")) + +-- check for correctness of the files in branch B +check(samefile("file1-1.1.4.1", "branchB/file1")) +check(samefile("file2-1.1", "branchB/file2")) + ============================================================ --- tests/importing_cvs_branches4/cvs-repository/test/file1,v a503a0993e33ed98011760a13f149b779553cd3b +++ tests/importing_cvs_branches4/cvs-repository/test/file1,v a503a0993e33ed98011760a13f149b779553cd3b @@ -0,0 +1,64 @@ +head 1.1; +access; +symbols + B:1.1.0.4 + A:1.1.0.2; +locks; strict; +comment @# @; + + +1.1 +date 2007.10.07.10.08.47; author markus; state Exp; +branches + 1.1.2.1 + 1.1.4.1; +next ; +commitid YMHwYoe49DBM0EAs; + +1.1.2.1 +date 2007.10.07.10.08.48; author markus; state Exp; +branches; +next ; +commitid DMK2IJ58G87N0EAs; + +1.1.4.1 +date 2007.10.07.10.08.50; author markus; state Exp; +branches; +next ; +commitid dje5pcBK25JN0EAs; + + +desc +@@ + + +1.1 +log address@hidden import +@ +text address@hidden 1.1 of test file1 +@ + + +1.1.4.1 +log address@hidden commit +@ +text address@hidden 1 +a1 1 +version 1.1.4.1 of test file1 +@ + + +1.1.2.1 +log address@hidden commit +@ +text address@hidden 1 +a1 1 +xxx +@ + ============================================================ --- tests/importing_cvs_branches4/cvs-repository/test/file2,v 3a080c2f4911fdf8a1624823878d036b1a8642d2 +++ tests/importing_cvs_branches4/cvs-repository/test/file2,v 3a080c2f4911fdf8a1624823878d036b1a8642d2 @@ -0,0 +1,46 @@ +head 1.1; +access; +symbols + B:1.1.0.4 + A:1.1.0.2; +locks; strict; +comment @# @; + + +1.1 +date 2007.10.07.10.08.47; author markus; state Exp; +branches + 1.1.2.1; +next ; +commitid YMHwYoe49DBM0EAs; + +1.1.2.1 +date 2007.10.07.10.08.48; author markus; state Exp; +branches; +next ; +commitid DMK2IJ58G87N0EAs; + + +desc +@@ + + +1.1 +log address@hidden import +@ +text address@hidden 1.1 of test file2 +@ + + +1.1.2.1 +log address@hidden commit +@ +text address@hidden 1 +a1 1 +version 1.1.2.1 of test file2 +@ + ============================================================ --- tests/importing_cvs_branches4/makerepo.sh 8a68a1be17de13d40647c6eeb872f0b2b3171637 +++ tests/importing_cvs_branches4/makerepo.sh 8a68a1be17de13d40647c6eeb872f0b2b3171637 @@ -0,0 +1,49 @@ +#!/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 +cvs add file1 file2 +cvs commit -m "initial import" file1 file2 + +# now we create a branch A +cvs tag -b A +cvs update -r A + +# a commit which will later conflict with one in branch B +echo "version 1.1.2.1 of test file2" > file2 +echo "xxx" > file1 +cvs commit -m "conflicting commit" file1 file2 + +# go back to the trunk and branch into B +cvs update -A +cvs tag -b B +cvs update -r B + +# a conflicting commit with (file2 of) branch A +echo "version 1.1.4.1 of test file1" > file1 +cvs commit -m "conflicting commit" file1 + +cd ../.. +rm -rf full_checkout + +# clean up the CVS repository bookkeeping dir +rm -rf cvs-repository/CVSROOT + ============================================================ --- tests/importing_cvs_branches3/__driver__.lua e1c22ea7eb81e795c01e4e456185cc7bab2a837b +++ tests/importing_cvs_branches3/__driver__.lua 7fbcf69fd29f27c255e13356d68acbcb78a6852c @@ -23,7 +23,7 @@ writefile("file2-1.1.2.1", "version 1.1. writefile("file2-1.1.2.1", "version 1.1.2.1 of test file2\n") -- import into monotone and check presence of files -xfail(mtn("--branch=test", "cvs_import", "cvs-repository/test"), 0, false, false) +check(mtn("--branch=test", "cvs_import", "cvs-repository/test"), 0, false, false) -- We currently don't handle blobs, which seem to belong to two different -- branches. See the branch_sanitizer.