# # # patch "ChangeLog" # from [1fc81bb7c6ea3e65c904d0ef0509711e01dac1ce] # to [b931b2587c40359b3fa7a71ce9f9f6bb46b93113] # # patch "rcs_import.cc" # from [89a1e2717aa501a19702bda13fa74ea2119badc1] # to [7554d086dfaa1bc452171314314cb8c1bddf5167] # ============================================================ --- ChangeLog 1fc81bb7c6ea3e65c904d0ef0509711e01dac1ce +++ ChangeLog b931b2587c40359b3fa7a71ce9f9f6bb46b93113 @@ -1,5 +1,10 @@ 2006-04-04 Markus Schiltknecht + * rcs_import.cc: added step 4: find the last cvs_cluster + for ET_BRANCH events. + +2006-04-04 Markus Schiltknecht + * rcs_import.cc: added type info to cvs_cluster so a cvs_cluster can now be a commit or a branchpoint. ============================================================ --- rcs_import.cc 89a1e2717aa501a19702bda13fa74ea2119badc1 +++ rcs_import.cc 7554d086dfaa1bc452171314314cb8c1bddf5167 @@ -1139,6 +1139,9 @@ // step 3: find the last still-live cluster to have touched this // file + // (ms) the current event needs to be inserted into a a cluster + // following (i.e. newer than) this cluster. Regardless if it's a + // commit or branch event. time_t time_of_last_cluster_touching_this_file = 0; unsigned clu = 0; @@ -1168,7 +1171,7 @@ if (i->type == ET_COMMIT) { - // step 4: find a cluster which starts on or after the + // step 4: find a commit cluster which starts on or after the // last_modify_time, which doesn't modify the file in question, // and which contains the same author and changelog as our // commit @@ -1176,12 +1179,12 @@ j != clusters.end(); ++j) { if (((*j)->first_time >= time_of_last_cluster_touching_this_file) - && ((*j)->type == i->type) + && ((*j)->type == ET_COMMIT) && ((*j)->author == i->author) && ((*j)->changelog == i->changelog) && ((*j)->entries.find(i->path) == (*j)->entries.end())) { - L(FL("picked existing cluster [t:%d] [a:%d] [c:%d]\n") + L(FL("picked existing cluster (commit) [t:%d] [a:%d] [c:%d]\n") % (*j)->first_time % (*j)->author % (*j)->changelog); @@ -1192,7 +1195,23 @@ } else if (i->type == ET_BRANCH) { - //TODO... + // step 4: find a branchpoint cluster which starts on or after + // the last_modify_time, which doesn't modify the file in + // question, and which contains the same author and changelog + // as our commit + for (cluster_set::const_iterator j = clusters.begin(); + j != clusters.end(); ++j) + { + if (((*j)->first_time >= time_of_last_cluster_touching_this_file) + && ((*j)->type == ET_BRANCH) + && ((*j)->entries.find(i->path) == (*j)->entries.end())) + { + L(FL("picked existing cluster (branchpoint) [t:%d]\n") + % (*j)->first_time); + + target = (*j); + } + } } // if we're still not finding an active cluster,