# # # patch "rcs_import.cc" # from [b2b5a23f32717c14b7ee9bc3ebb04fbf8441b3d3] # to [b75ec296229a02e0c289b2d8d8287a3b62fd84e1] # # patch "tests/importing_cvs_cycle_splitter6/__driver__.lua" # from [893d23c08fdfdf6854cabc7fc555d9dc16865c28] # to [7f748b01af661c8c4b74cd4782eda7ed1b14fbc2] # ============================================================ --- rcs_import.cc b2b5a23f32717c14b7ee9bc3ebb04fbf8441b3d3 +++ rcs_import.cc b75ec296229a02e0c289b2d8d8287a3b62fd84e1 @@ -3519,14 +3519,15 @@ split_cycle(cvs_history & cvs, vector largest_gap_candidates; - // If there are no type 1 events, we can split between the type 2 and - // type 3 event without the need for a clear timestamp. + // If we can split between the type 2 and type 3 events without the need + // for a clear timestamp, we put the candidates in here. vector, set > > event_splits; - // We collect all blobs (or sets of blobs) which can be split to resolve - // the cycle. This includes candidates for which we couldn't find a - // simple timestamp to split at. - vector > splittable_blob_sets; + // If there are type 1 events, between type 2 and type 3 ones, for which + // we cannot clearly decide, we put the candidates in here (and split + // them only as a last resort). + vector, set > > event_splits2; + unsigned int no_blobs_to_split; for (no_blobs_to_split = 1; no_blobs_to_split < cycle_members.size(); ++no_blobs_to_split) @@ -3734,11 +3735,22 @@ split_cycle(cvs_history & cvs, vector, set > >:: + iterator i; + + i = event_splits2.insert(event_splits2.end(), + make_pair(candidates, set())); + + // fill the set with the type 2 events + for (vector::iterator j + = type2events.begin(); + j != type2events.end(); ++j) + safe_insert(i->second, *j); } continue; } @@ -3802,7 +3814,7 @@ split_cycle(cvs_history & cvs, vector & candidates = event_splits.begin()->first; set & split_events = event_splits.begin()->second; @@ -3843,11 +3857,23 @@ split_cycle(cvs_history & cvs, vector & candidates = event_splits2.begin()->first; + set & split_events = event_splits2.begin()->second; + + split_by_event_set func(split_events); + for (set::iterator i = candidates.begin(); + i != candidates.end(); ++i) + { + I(!cvs.blobs[*i].get_digest().is_branch_start()); + I(!cvs.blobs[*i].get_digest().is_tag()); + + split_blob_at(cvs, *i, func); + } } else { ============================================================ --- tests/importing_cvs_cycle_splitter6/__driver__.lua 893d23c08fdfdf6854cabc7fc555d9dc16865c28 +++ tests/importing_cvs_cycle_splitter6/__driver__.lua 7f748b01af661c8c4b74cd4782eda7ed1b14fbc2 @@ -24,5 +24,5 @@ check(get("cvs-repository")) -- events it doesn't know where to put. -- import into monotone and check presence of files -xfail(mtn("--branch=test", "cvs_import", "--debug", "cvs-repository/test"), 0, false, false) +check(mtn("--branch=test", "cvs_import", "--debug", "cvs-repository/test"), 0, false, false)