# # # patch "rcs_import.cc" # from [26e8cfcecd0093550dec82675e8ca0f9ee77c031] # to [e32acdd1f6e08f7cf0d7319cf543bc4ff11cadbc] # ============================================================ --- rcs_import.cc 26e8cfcecd0093550dec82675e8ca0f9ee77c031 +++ rcs_import.cc e32acdd1f6e08f7cf0d7319cf543bc4ff11cadbc @@ -82,14 +82,16 @@ struct cvs_branch; struct cvs_branch; +typedef unsigned long long digest_type; + struct cvs_event_digest { - unsigned long digest; + digest_type digest; cvs_event_digest(cvs_author a, cvs_changelog c, cvs_tag t, cvs_branchname b) { - digest = a | (c << 16) | (t << 32) | (b << 48); + digest = (digest_type) a | ((digest_type) c << 16) | ((digest_type) t << 32) | ((digest_type) b << 48); } bool operator < (const struct cvs_event_digest & other) const @@ -178,31 +180,36 @@ cvs_branch { } - void append_event(shared_ptr c) + + cvs_blob get_blob(const cvs_event_digest & d) { - if (c->type == ET_COMMIT) - { - I(c->time != 0); - has_a_commit = true; - } - typedef multimap::const_iterator ity; - pair range = blobs.equal_range(c->get_digest()); + pair range = blobs.equal_range(d); - if (range.first == blobs.end()) + if (range.first == range.second) { - blobs.insert(make_pair(c->get_digest(), + blobs.insert(make_pair(d, vector >())); - range = blobs.equal_range(c->get_digest()); - I(range.first != blobs.end()); + range = blobs.equal_range(d); + I(range.first != range.second); } // it's a multimap, but we want only one blob per digest // at this time (when filling it) - I(range.first == range.second); + I(range.first != range.second); + return range.first->second; + } - cvs_blob blob_events = range.first->second; - blob_events.push_back(c); + void append_event(shared_ptr c) + { + if (c->type == ET_COMMIT) + { + I(c->time != 0); + has_a_commit = true; + } + + cvs_blob b = get_blob(c->get_digest()); + b.push_back(c); } };