# # # patch "rcs_import.cc" # from [1ef073b17e8e4e0574ce3b4e90a7683514878e8d] # to [cb206243cd52a2180c86e62ed029a3ba519ea681] # ============================================================ --- rcs_import.cc 1ef073b17e8e4e0574ce3b4e90a7683514878e8d +++ rcs_import.cc cb206243cd52a2180c86e62ed029a3ba519ea681 @@ -352,6 +352,12 @@ cvs_history // this map is cleared for every RCS file. map branch_first_entries; + // tag -> revision + // + // used to resolve the *last* revision which has a given tag + // applied; this is the revision which wins the tag. + map resolved_tags; + file_path curr_file; cvs_path curr_file_interned; @@ -1834,6 +1840,22 @@ import_cvs_repo(system_path const & cvsr guard.commit(); } + // add all the tags + { + ticker n_tags(_("tags"), "t", 1); + packet_db_writer dbw(app); + transaction_guard guard(app.db); + for (map::const_iterator i = cvs.resolved_tags.begin(); + i != cvs.resolved_tags.end(); ++i) + { + string tag = cvs.tag_interner.lookup(i->first); + ui.set_tick_trailer("marking tag " + tag); + app.get_project().put_tag(i->second, tag, dbw); + ++n_tags; + } + guard.commit(); + } + return; } @@ -2172,8 +2194,7 @@ blob_consumer::consume_blob(cvs_blob & b boost::static_pointer_cast( *blob.begin()); - // FIXME: before, I've only inserted into cvs.resolved_tags, - // but I should just add the cert here... + cvs.resolved_tags.insert(make_pair(cte->tag, bstate.current_rid)); } } else