# # # patch "rcs_import.cc" # from [2388a42613d30026597f1d0afc3f4ba90ed777e8] # to [e06e1b8ae93074b87befa90c00db91c8d9ddcceb] # ============================================================ --- rcs_import.cc 2388a42613d30026597f1d0afc3f4ba90ed777e8 +++ rcs_import.cc e06e1b8ae93074b87befa90c00db91c8d9ddcceb @@ -665,6 +665,7 @@ process_rcs_branch(string const & begin_ static void process_rcs_branch(string const & begin_version, + cvs_event_ptr const & dep_commit, vector< piece > const & begin_lines, data const & begin_data, hexenc const & begin_id, @@ -674,7 +675,7 @@ process_rcs_branch(string const & begin_ bool dryrun) { cvs_event_ptr curr_commit; - cvs_event_ptr last_commit; + cvs_event_ptr last_commit = dep_commit; string curr_version = begin_version; scoped_ptr< vector< piece > > next_lines(new vector); scoped_ptr< vector< piece > > curr_lines(new vector @@ -811,21 +812,21 @@ process_rcs_branch(string const & begin_ dryrun); } + cvs_event_ptr branch_event = + boost::static_pointer_cast( + shared_ptr( + new cvs_event_branch(curr_commit, + cvs.branchname_interner.intern(branchname)))); + // recursively process child branches - process_rcs_branch(*i, branch_lines, branch_data, - branch_id, r, db, cvs, dryrun); + process_rcs_branch(*i, branch_event, branch_lines, branch_data, + branch_id, r, db, cvs, dryrun); if (!priv) L(FL("finished RCS branch %s = '%s'") % (*i) % branchname); else L(FL("finished private RCS branch %s") % (*i)); - cvs_event_ptr branch_event = - boost::static_pointer_cast( - shared_ptr( - new cvs_event_branch(curr_commit, - cvs.branchname_interner.intern(branchname)))); - // FIXME: is this still needed here? // make sure curr_commit exists in the blob cvs.get_blob(curr_commit->get_digest(), false); @@ -886,8 +887,10 @@ import_rcs_file_with_cvs(string const & global_pieces.reset(); global_pieces.index_deltatext(r.deltatexts.find(r.admin.head)->second, head_lines); - process_rcs_branch(r.admin.head, head_lines, dat, id, r, app.db, cvs, - app.opts.dryrun); + + // start processing branches, with an empty cvs_event_ptr + process_rcs_branch(r.admin.head, cvs_event_ptr(), head_lines, dat, id, + r, app.db, cvs, app.opts.dryrun); global_pieces.reset(); }