# # # patch "ChangeLog" # from [e0e4a8a80d3187f1cec582f349bd2b4c8f55591d] # to [e9712cd31951eaf21c736cb5be24f47685ddc062] # # patch "rcs_import.cc" # from [0de2b62e2c973f4c94592cff4990f0a43eb70294] # to [86fccfa8dc102b229ed013d38177862c02282e96] # ============================================================ --- ChangeLog e0e4a8a80d3187f1cec582f349bd2b4c8f55591d +++ ChangeLog e9712cd31951eaf21c736cb5be24f47685ddc062 @@ -1,3 +1,7 @@ +2006-04-04 Markus Schiltknecht + + * rcs_import.cc: Renamed cvs_commit to cvs_event + 2006-04-02 Matthew Nicholson * contrib/get_passphrase_from_file.lua: Added. This hook reads ============================================================ --- rcs_import.cc 0de2b62e2c973f4c94592cff4990f0a43eb70294 +++ rcs_import.cc 86fccfa8dc102b229ed013d38177862c02282e96 @@ -55,14 +55,29 @@ struct cvs_history; + +typedef enum event_type +{ + ET_COMMIT, + ET_BRANCH +} event_type; + + struct -cvs_commit +cvs_event { - cvs_commit(rcs_file const & r, + cvs_event(event_type ty, + time_t ti, + cvs_path p, + cvs_history & cvs); + + cvs_event(rcs_file const & r, string const & rcs_version, file_id const & ident, cvs_history & cvs); + event_type type; + bool is_synthetic_branch_root; time_t time; bool alive; @@ -72,7 +87,7 @@ cvs_path path; vector tags; - bool operator<(cvs_commit const & other) const + bool operator<(cvs_event const & other) const { return time < other.time; } @@ -87,7 +102,7 @@ time_t first_commit; map live_at_beginning; - vector lineage; + vector lineage; cvs_branch() : has_a_branchpoint(false), @@ -133,10 +148,10 @@ } } - void append_commit(cvs_commit const & c) + void append_event(cvs_event const & c) { I(c.time != 0); - note_commit(c.time); + if (c.type == ET_COMMIT) note_commit(c.time); lineage.push_back(c); } }; @@ -222,11 +237,13 @@ } -cvs_commit::cvs_commit(rcs_file const & r, +cvs_event::cvs_event(rcs_file const & r, string const & rcs_version, file_id const & ident, cvs_history & cvs) { + type = ET_COMMIT; + map >::const_iterator delta = r.deltas.find(rcs_version); I(delta != r.deltas.end()); @@ -283,6 +300,16 @@ } +cvs_event::cvs_event(event_type ty, time_t ti, cvs_path p, cvs_history & cvs) + : type(ty), + time(ti), + path(p) +{ + author = cvs.author_interner.intern("branchpoint"); + changelog = cvs.changelog_interner.intern("synthetic branchpoint changelog"); +} + + // piece table stuff struct piece; @@ -564,10 +591,10 @@ { L(FL("version %s has %d lines\n") % curr_version % curr_lines->size()); - cvs_commit curr_commit(r, curr_version, curr_id, cvs); + cvs_event curr_commit(r, curr_version, curr_id, cvs); if (!curr_commit.is_synthetic_branch_root) { - cvs.stk.top()->append_commit(curr_commit); + cvs.stk.top()->append_event(curr_commit); ++cvs.n_versions; } @@ -1067,16 +1094,24 @@ // step 1: sort the lineage stable_sort(branch->lineage.begin(), branch->lineage.end()); - for (vector::const_iterator i = branch->lineage.begin(); + for (vector::const_iterator i = branch->lineage.begin(); i != branch->lineage.end(); ++i) { commits_remaining--; - L(FL("examining next commit [t:%d] [p:%s] [a:%s] [c:%s]\n") - % i->time - % cvs.path_interner.lookup(i->path) - % cvs.author_interner.lookup(i->author) - % cvs.changelog_interner.lookup(i->changelog)); + if (i->type == ET_COMMIT) + { + L(FL("examining next event: commit [t:%d] [p:%s] [a:%s] [c:%s]\n") + % i->time + % cvs.path_interner.lookup(i->path) + % cvs.author_interner.lookup(i->author) + % cvs.changelog_interner.lookup(i->changelog)); + } + else + { + L(FL("examining next event: branch [t:%d]\n") + % i->time); + } // step 2: expire all clusters from the beginning of the set which // have passed the window size