# # # patch "rcs_import.cc" # from [4b20e7930c43b4126104f0d8c82ef7c6256ad3e4] # to [250da5ff35d10bf91fed02a04f5947ceb5326f8d] # ============================================================ --- rcs_import.cc 4b20e7930c43b4126104f0d8c82ef7c6256ad3e4 +++ rcs_import.cc 250da5ff35d10bf91fed02a04f5947ceb5326f8d @@ -151,7 +151,7 @@ public: public: shared_ptr branch; - cvs_event_branch(shared_ptr dep); + cvs_event_branch(shared_ptr dep, shared_ptr b); virtual cvs_event_digest get_digest(void); }; @@ -382,10 +382,13 @@ cvs_commit::get_digest(void) return cvs_event_digest(author, changelog, 0, 0); }; -cvs_event_branch::cvs_event_branch(shared_ptr dep) +cvs_event_branch::cvs_event_branch(shared_ptr dep, + shared_ptr b) { type = ET_BRANCH; + dependency = dep; path = dep->path; + branch = b; } cvs_event_digest @@ -397,6 +400,7 @@ cvs_event_tag::cvs_event_tag(shared_ptr< cvs_event_tag::cvs_event_tag(shared_ptr dep, const cvs_tag t) { type = ET_TAG; + dependency = dep; path = dep->path; tag = t; } @@ -754,10 +758,6 @@ process_branch(string const & begin_vers else priv = true; - /* add a branch event */ - shared_ptr branch_event = - shared_ptr(new cvs_event_branch(curr_commit)); - L(FL("following RCS branch %s = '%s'\n") % (*i) % branch); construct_version(*curr_lines, *i, branch_lines, r); @@ -769,19 +769,20 @@ process_branch(string const & begin_vers process_branch(*i, curr_commit, branch_lines, branch_data, branch_id, r, db, cvs); - /* link the branch event to the branch */ - branch_event->branch = cvs.stk.top(); + /* add a branch event, linked to this new branch */ + shared_ptr branch_event = + shared_ptr(new cvs_event_branch(curr_commit, cvs.stk.top())); cvs.pop_branch(); + L(FL("finished RCS branch %s = '%s'") % (*i) % branch); + /* then append it to the parent branch */ cvs.stk.top()->append_event(branch_event); L(FL("added branch event for file %s from branch %s into branch %s") % cvs.path_interner.lookup(curr_commit->path) % cvs.bstk.top() % branch); - - L(FL("finished RCS branch %s = '%s'") % (*i) % branch); } if (!r.deltas.find(curr_version)->second->next.empty()) @@ -1065,19 +1066,27 @@ resolve_blob_dependencies(cvs_history &c { L(FL("branch %s currently has %d blobs.") % branchname % branch->blobs.size()); - // first try to resolve all intra-blob dependencies + // first split blobs which have events for the same file (i.e. intra-blob + // dependencies) typedef multimap::const_iterator ity; for (ity i = branch->blobs.begin(); i != branch->blobs.end(); ++i) { cvs_blob blob = i->second; - L(FL("blob %s contains:") % i->first); - L(FL(" %d events:") % i->second.size()); + L(FL("blob %s contains %d events:") % i->first % i->second.size()); for(vector< shared_ptr< cvs_event> >::const_iterator j = blob.begin(); j != blob.end(); ++j) { shared_ptr event = *j; + /* check the event's dependency */ + if (event->dependency) + { + cvs_event_digest d = event->dependency->get_digest(); + blob_iterator b = branch->get_blob(d); + L(FL(" depends on blob %d") % b->first); + } + if (event->type == ET_COMMIT) { L(FL(" commit file: %s") % cvs.path_interner.lookup(event->path)); @@ -1090,14 +1099,6 @@ resolve_blob_dependencies(cvs_history &c { L(FL(" branch file: %s") % cvs.path_interner.lookup(event->path)); } -/* - if (j->type == ET_COMMIT) - { - L(FL(" commit")); -// shared_ptr c = j; -// L(FL(" commit of %s") % c->path - } -*/ } } }