# # # patch "mtn_cvs/cvs_sync.cc" # from [37aa9d74285c83dbef1ea78ad89454c9734520ae] # to [c075c339379413887ec350b91ffcce81382f74e9] # # patch "mtn_cvs/cvs_sync.hh" # from [40ef9b22375392bfb4986786f4cd50f10f8f78ae] # to [d590a954bcb39ca1e333532bd4945e3267c4995f] # ============================================================ --- mtn_cvs/cvs_sync.cc 37aa9d74285c83dbef1ea78ad89454c9734520ae +++ mtn_cvs/cvs_sync.cc c075c339379413887ec350b91ffcce81382f74e9 @@ -99,6 +99,35 @@ void cvs_repository::get_all_files() } } +struct cvs_repository::clean_get_all_files_log_cb : rlog_callbacks +{ std::map &files; + std::map &dead; + clean_get_all_files_log_cb(std::map &f, std::map &d) : files(f), dead(d) {} + virtual void file(const std::string &file,const std::string &head_rev) const + { L(FL("get_all_files_log_cb file: %s head rev: %s") % file % head_rev); + files[file] = head_rev; + } + virtual void tag(const std::string &file,const std::string &tag, + const std::string &revision) const {} + virtual void revision(const std::string &file,time_t t, + const std::string &rev,const std::string &author, + const std::string &state,const std::string &log) const { + L(FL("get_all_files_log_cb file: %s has state: %s in rev: %s") % file % state % rev); + if (rev == files[file] && state=="dead") { + dead[file] = true; + } + } +}; + +// get all available files, their newest revision and whether they're dead or not +void cvs_repository::get_all_files(std::map &files) +{ // rlist seems to be more efficient but it's hard to guess the directory the + // server talks about + std::map dead; // this is not used by this function + I(CommandValid("rlog")); + RLog(clean_get_all_files_log_cb(files, dead),false,"-N","-h","--",module.c_str(),(void*)0); +} + std::string debug_manifest(const cvs_manifest &mf) { std::string result; for (cvs_manifest::const_iterator i=mf.begin(); i!=mf.end(); ++i) ============================================================ --- mtn_cvs/cvs_sync.hh 40ef9b22375392bfb4986786f4cd50f10f8f78ae +++ mtn_cvs/cvs_sync.hh d590a954bcb39ca1e333532bd4945e3267c4995f @@ -108,6 +108,7 @@ public: typedef cvs_manifest tree_state_t; struct prime_log_cb; struct get_all_files_log_cb; + struct clean_get_all_files_log_cb; struct get_all_files_list_cb; struct update_cb; @@ -144,6 +145,7 @@ private: void check_split(const cvs_file_state &s, const cvs_file_state &end, const std::set::iterator &e); void get_all_files(); + void get_all_files(std::map &files); void update(std::set::const_iterator s, std::set::iterator s2,cvs_file_path const& file, std::string &contents);