# # # patch "rcs_import.cc" # from [2d68ba439bed095a101c067010f10e375357d5dd] # to [618af5596d4a8157e6b81051d1c2869928489206] # ============================================================ --- rcs_import.cc 2d68ba439bed095a101c067010f10e375357d5dd +++ rcs_import.cc 618af5596d4a8157e6b81051d1c2869928489206 @@ -376,6 +376,14 @@ public: { has_cached_deps = false; } + + time_t get_avg_time(void) const + { + long long avg = 0; + for (blob_event_iter i = events.begin(); i != events.end(); ++i) + avg += (*i)->time; + return (time_t) avg / events.size(); + } }; typedef struct @@ -575,13 +583,13 @@ public: public: cvs_history & cvs; - event_ptr_path_strcmp(cvs_history & c) + blob_index_time_cmp(cvs_history & c) : cvs(c) { }; bool operator() (const cvs_blob_index a, const cvs_blob_index b) { - return cvs.blobs[a].time < cvs.blobs[b].time; + return cvs.blobs[a].get_avg_time() < cvs.blobs[b].get_avg_time(); } }; @@ -2540,8 +2548,7 @@ blob_consumer::operator()(cvs_blob_index { if (app.db.put_revision(child_rid, *rev)) { - // FIXME: calculate an avg time - time_t commit_time = ce->time; + time_t commit_time = blob.get_avg_time(); string author, changelog; cvs.split_authorclog(ce->authorclog, author, changelog);