# # # add_dir "tests/importing_cvs_with_multiple_vendor_imports2" # # add_dir "tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository" # # add_dir "tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository/test" # # add_file "tests/importing_cvs_with_multiple_vendor_imports2/__driver__.lua" # content [74aa11bcfbb956891a4c421cbe1449c1948beb46] # # add_file "tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository/test/fileA,v" # content [c9ddea7b4f0d6e28c1c90854259c924b230ae807] # # add_file "tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository/test/fileB,v" # content [85308b54931e8591fa2607bd0441882ca67b260a] # # add_file "tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository/test/fileC,v" # content [90dbc04b7ee2c4d6ad2c736547d34a46e4332adc] # # add_file "tests/importing_cvs_with_multiple_vendor_imports2/makerepo.sh" # content [506e3d057acca6ef666bdaf561809ba11cf65797] # # patch "rcs_import.cc" # from [8c418d3313e9eae7ac1e44fb5ebdb111768bbd4b] # to [9d3bf6d95c3793de019aea7d7a8bc400e0e51e72] # # set "tests/importing_cvs_with_multiple_vendor_imports2/makerepo.sh" # attr "mtn:execute" # value "true" # ============================================================ --- tests/importing_cvs_with_multiple_vendor_imports2/__driver__.lua 74aa11bcfbb956891a4c421cbe1449c1948beb46 +++ tests/importing_cvs_with_multiple_vendor_imports2/__driver__.lua 74aa11bcfbb956891a4c421cbe1449c1948beb46 @@ -0,0 +1,33 @@ + +mtn_setup() + +-- See makerepo.sh on how this repository was created. +check(get("cvs-repository")) + + +-- import into monotone and check presence of files +check(mtn("--branch=test", "cvs_import", "cvs-repository/test"), 0, false, false) + +-- check if all non-empty branches were imported +check(mtn("list", "branches"), 0, true, false) +check(samelines("stdout", {"test", "test.VendorA", "test.VendorB"})) + +check(mtn("checkout", "--branch=test", "maindir"), 0, false, false) +check(indir("maindir", mtn("list", "known")), 0, true, false) +check(samelines("stdout", {"fileA", "fileB", "fileC"})) +check(samelines("maindir/fileA", {"fileA from VendorA"})) +check(samelines("maindir/fileB", {"fileB from VendorB - changed", + "resolved commit", + "last line for fileB"})) +check(samelines("maindir/fileC", {"our own additions"})) + +check(mtn("checkout", "--branch=test.VendorA", "vendorA_co"), 0, false, false) +check(indir("vendorA_co", mtn("list", "known")), 0, true, false) +check(samelines("stdout", {"fileA"})) +check(samelines("vendorA_co/fileA", {"fileA from VendorA - changed"})) + +check(mtn("checkout", "--branch=test.VendorB", "vendorB_co"), 0, false, false) +check(indir("vendorB_co", mtn("list", "known")), 0, true, false) +check(samelines("stdout", {"fileB"})) +check(samelines("vendorB_co/fileB", {"fileB from VendorB - changed"})) + ============================================================ --- tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository/test/fileA,v c9ddea7b4f0d6e28c1c90854259c924b230ae807 +++ tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository/test/fileA,v c9ddea7b4f0d6e28c1c90854259c924b230ae807 @@ -0,0 +1,62 @@ +head 1.1; +branch 1.1.1; +access; +symbols + VendorA_REL_2:1.1.1.2 + VendorA_REL_1:1.1.1.1 + VendorA:1.1.1; +locks; strict; +comment @# @; + + +1.1 +date 2007.11.09.21.16.43; author markus; state Exp; +branches + 1.1.1.1; +next ; +commitid Ihwgyvb3oU6aEWEs; + +1.1.1.1 +date 2007.11.09.21.16.43; author markus; state Exp; +branches; +next 1.1.1.2; +commitid Ihwgyvb3oU6aEWEs; + +1.1.1.2 +date 2007.11.09.21.17.00; author markus; state Exp; +branches; +next ; +commitid IAFEE2Fzfj1gEWEs; + + +desc +@@ + + +1.1 +log address@hidden revision +@ +text address@hidden from VendorA +@ + + +1.1.1.1 +log address@hidden import from VendorA +@ +text +@@ + + +1.1.1.2 +log address@hidden import from VendorA +@ +text address@hidden 1 +a1 1 +fileA from VendorA - changed +@ + ============================================================ --- tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository/test/fileB,v 85308b54931e8591fa2607bd0441882ca67b260a +++ tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository/test/fileB,v 85308b54931e8591fa2607bd0441882ca67b260a @@ -0,0 +1,111 @@ +head 1.4; +access; +symbols + VendorB_REL_2:1.1.1.2 + VendorB_REL_1:1.1.1.1 + VendorB:1.1.1; +locks; strict; +comment @# @; + + +1.4 +date 2007.11.09.21.17.19; author markus; state Exp; +branches; +next 1.3; +commitid UlQ78qN71jQmEWEs; + +1.3 +date 2007.11.09.21.17.13; author markus; state Exp; +branches; +next 1.2; +commitid Ui7RX8ncQQvkEWEs; + +1.2 +date 2007.11.09.21.17.11; author markus; state Exp; +branches; +next 1.1; +commitid kfaG15c7GwYjEWEs; + +1.1 +date 2007.11.09.21.16.48; author markus; state Exp; +branches + 1.1.1.1; +next ; +commitid pfFEihbj6QTbEWEs; + +1.1.1.1 +date 2007.11.09.21.16.48; author markus; state Exp; +branches; +next 1.1.1.2; +commitid pfFEihbj6QTbEWEs; + +1.1.1.2 +date 2007.11.09.21.17.12; author markus; state Exp; +branches; +next ; +commitid 0dpjMpwVq6hkEWEs; + + +desc +@@ + + +1.4 +log address@hidden commit on mainline +@ +text address@hidden from VendorB - changed +resolved commit +last line for fileB +@ + + +1.3 +log address@hidden changes from VendorB +@ +text address@hidden 1 +@ + + +1.2 +log address@hidden commit on mainline +@ +text address@hidden 2 +a2 2 +fileB from VendorB +conflicting commit +@ + + +1.1 +log address@hidden revision +@ +text address@hidden 1 +@ + + +1.1.1.1 +log address@hidden import from VendorB +@ +text +@@ + + +1.1.1.2 +log address@hidden import from VendorB +@ +text address@hidden 1 +a1 1 +fileB from VendorB - changed +@ + ============================================================ --- tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository/test/fileC,v 90dbc04b7ee2c4d6ad2c736547d34a46e4332adc +++ tests/importing_cvs_with_multiple_vendor_imports2/cvs-repository/test/fileC,v 90dbc04b7ee2c4d6ad2c736547d34a46e4332adc @@ -0,0 +1,25 @@ +head 1.1; +access; +symbols; +locks; strict; +comment @# @; + + +1.1 +date 2007.11.09.21.16.54; author markus; state Exp; +branches; +next ; +commitid gh3Uuu7zAoZdEWEs; + + +desc +@@ + + +1.1 +log address@hidden 0 +@ +text address@hidden own additions +@ ============================================================ --- tests/importing_cvs_with_multiple_vendor_imports2/makerepo.sh 506e3d057acca6ef666bdaf561809ba11cf65797 +++ tests/importing_cvs_with_multiple_vendor_imports2/makerepo.sh 506e3d057acca6ef666bdaf561809ba11cf65797 @@ -0,0 +1,86 @@ +#!/bin/sh + +CVSROOT=`pwd`/cvs-repository +export CVSROOT + +# deleting the existing cvs-repository +rm -vrf $CVSROOT test vendorA_dir vendorB_dir + +# initializing a new repository +cvs init + +# the first vendor import +mkdir vendorA_dir +cd vendorA_dir +echo "fileA from VendorA" > fileA +cvs import -m "Initial import from VendorA" test VendorA VendorA_REL_1 +cd .. + +sleep 5 + +# the second vendor import +mkdir vendorB_dir +cd vendorB_dir +echo "fileB from VendorB" > fileB +cvs import -m "Initial import from VendorB" test VendorB VendorB_REL_1 +cd .. + +sleep 5 + +# checkout the repository and commit some files +cvs co test +cd test +echo "our own additions" > fileC +cvs add fileC +cvs commit -m "commit 0" + +sleep 5 + +# updates from VendorA +cd ../vendorA_dir +echo "fileA from VendorA - changed" > fileA +cvs import -m "Initial import from VendorA" test VendorA VendorA_REL_2 + +sleep 5 + +# update mainline checkout +cd ../test +cvs update + +sleep 5 + +# another commit, this will conflict with the update from VendorB +echo "conflicting commit" >> fileB +cvs commit -m "conflicting commit on mainline" + +# updates from VendorB +cd ../vendorB_dir +echo "fileB from VendorB - changed" > fileB +cvs import -m "Initial import from VendorB" test VendorB VendorB_REL_2 + +# merge with mainline +cd ../ +# rm -rf test +cvs checkout -jVendorB_REL_1 -j VendorB_REL_2 test +cd test + +echo "cvs update:" +cvs update +echo "cvs diff -c:" +cvs diff -c +echo "fileB from VendorB - changed" > fileB +echo "resolved commit" >> fileB +cvs commit -m "merged changes from VendorB" + +sleep 5 + +# another commit, this will conflict with the update from VendorB +echo "last line for fileB" >> fileB +cvs commit -m "last commit on mainline" + +cd .. +rm -rf test vendorA_dir vendorB_dir + +# clean up the CVS repository bookkeeping dir +rm -rf cvs-repository/CVSROOT + ============================================================ --- rcs_import.cc 8c418d3313e9eae7ac1e44fb5ebdb111768bbd4b +++ rcs_import.cc 9d3bf6d95c3793de019aea7d7a8bc400e0e51e72 @@ -2403,7 +2403,7 @@ public: if (a_has_branch && b_has_branch) { - I(!cvs.blobs[e.second].get_digest().is_branch_end()); + // I(!cvs.blobs[e.second].get_digest().is_branch_end()); // Blob e.second seems to be part of two (or even more) // branches, thus we need to split that blob. @@ -2476,7 +2476,8 @@ public: if (cvs.blobs[path_a[1]].get_digest().is_symbol() && cvs.blobs[path_a[2]].get_digest().is_branch_start() && - cvs.blobs[e.second].get_digest().is_symbol()) + cvs.blobs[e.second].get_digest().is_symbol() && + path_b.size() == 2) { // This is a special case, where none of the commits in path_a // touch a certain file. A symbol then has a dependency on @@ -2486,11 +2487,12 @@ public: // // common // ancestor - // / \ - // branch | - // symbol | - // | | - // branch | + // (symbol) + // / \ path_b is pretty empty, i.e. + // branch | there is a direct dependency + // symbol | from the common ancestor (a + // | | branch symbol) to e.second + // branch | (also a symbol, but any kind) // start | // | | // (+) | @@ -2501,6 +2503,38 @@ public: cvs.remove_deps(e.second, bi_b); edges_removed++; } + else if ((path_a[0] == cvs.root_blob) && (path_a.size() == 5) && + cvs.blobs[e.second].get_digest().is_symbol()) + { + // another special case: with a vendor branch, 1.1.1.1 gets + // tagged, instead of 1.1. This poses a problem for further + // sub-branches, as those might have dependencies on the + // vendor branch as well as on the trunk. + // + // We simply remove the dependency to the vendor branch, + // which are imported independently. + // + // root + // blob + // / \ + // vendor | + // branch | + // symbol initial + // | import + // vendor (1.1) + // branch | + // start | + // | (+) + // initial | + // import | + // (1.1.1.1) | + // \ / + // e.second + // (symbol) + // + cvs.remove_deps(e.second, bi_a); + edges_removed++; + } else { // Okay, it's getting tricky here: e.second is not a branch