# # # patch "rcs_import.cc" # from [e18f1a5715bc4c402d918e94dbb0a6ff49300e4d] # to [e7cd48ae79a7335f07238cb9d018b2d20512ba76] # ============================================================ --- rcs_import.cc e18f1a5715bc4c402d918e94dbb0a6ff49300e4d +++ rcs_import.cc e7cd48ae79a7335f07238cb9d018b2d20512ba76 @@ -73,7 +73,6 @@ using boost::lexical_cast; // additional debugging information // not defined: DEBUG_BLOB_SPLITTER // not defined: DEBUG_GRAPHVIZ -// not defined: DEBUG_DIJKSTRA // cvs history recording stuff @@ -873,6 +872,17 @@ get_event_repr(cvs_history & cvs, cvs_ev } } +template void +log_path(cvs_history & cvs, const string & msg, + const T & begin, const T & end) +{ + L(FL("%s") % msg); + for (T i = begin; i != end; ++i) + L(FL(" blob: %d:\t%s") + % *i + % get_event_repr(cvs, *cvs.blobs[*i].begin())); +} + static bool is_sbr(shared_ptr dl, shared_ptr dt) @@ -2072,16 +2082,10 @@ dijkstra_shortest_path(cvs_history &cvs, // on the path. These are part of the cycle we want to // split. I(break_on_grey || bi == to); -#ifdef DEBUG_DIJKSTRA - L(FL("dijkstra's algorithm, shortest path:")); -#endif while (true) { *ity++ = bi; -#ifdef DEBUG_DIJKSTRA - L(FL(" blob %d.") % bi); -#endif I(distances.count(bi) > 0); if (bi == from) @@ -2262,14 +2266,6 @@ void }; void -log_path(vector const & path, string const & str) -{ - L(FL("%s") % str); - for (vector::const_iterator i = path.begin(); i != path.end(); ++i) - L(FL(" blob: %d") % *i); -} - -void split_blob_at(cvs_history & cvs, const cvs_blob_index blob_to_split, split_decider_func & split_decider); @@ -2397,8 +2393,8 @@ public: return; #ifdef DEBUG_BLOB_SPLITTER - log_path(path_a, "handling path a:"); - log_path(path_b, " path b:"); + log_path(cvs, "handling path a:", path_a.begin(), path_a.end()); + log_path(cvs, " path b:", path_b.begin(), path_b.end()); L(FL(" %s") % (switch_needed ? "switch needed" : "no switch needed")); #endif @@ -2419,8 +2415,8 @@ public: if (!cross_path.empty()) { #ifdef DEBUG_BLOB_SPLITTER - L(FL(" found cross path:")); - log_path(cross_path, " cross path:"); + log_path(cvs, " found cross path:", + cross_path.begin(), cross_path.end()); #endif // Find the first element in the cross path, which is also