# # # patch "mtn_cvs/cvs_sync.cc" # from [8cbe13916caf7c3d0db0c8a59e34ce40f2536736] # to [2f823a8ff98161852801ec5121a8c1441b28779c] # # patch "mtn_cvs/mtn_cvs.cc" # from [76fc48d3793c3695dece4786fa1183dc2d4e61ce] # to [1b248c4fa03423e74aeb98e410319106103fe5b3] # # patch "mtn_cvs/options_list.hh" # from [3bab48751ad37ca16b591c2fdddbe3689c656809] # to [ee5da97b4be16282945d18c99711c7e32a450fd8] # ============================================================ --- mtn_cvs/cvs_sync.cc 8cbe13916caf7c3d0db0c8a59e34ce40f2536736 +++ mtn_cvs/cvs_sync.cc 2f823a8ff98161852801ec5121a8c1441b28779c @@ -1308,6 +1308,8 @@ static void guess_repository(std::string } last_state=app.get_sync_info(lastid,app.opts.domain()); cvs_repository::parse_cvs_cert_header(last_state,app.opts.domain(),repository,module,branch); + if (app.opts.full) + last_state = mtn_automate::sync_map_t(); if (branch.empty()) L(FL("using module '%s' in repository '%s'\n") % module % repository); else @@ -1383,7 +1385,7 @@ cvs_sync::cvs_repository *cvs_sync::prep if (!getenv("CVS_CLIENT_LOG")) repo->GzipStream(3); - if (!last_sync_info.empty()) + if (app.opts.full || !last_sync_info.empty()) { repo->parse_module_paths(last_sync_info); repo->process_sync_info(last_sync_info, lastid); } @@ -1519,18 +1521,17 @@ void cvs_repository::update() const cvs_manifest &m=get_files(now); file_revisions.reserve(m.size()); -#warning Turn this strict sync checking into an option - if (true) + if (app.opts.extended_checking) { for (cvs_manifest::const_iterator i=m.begin();i!=m.end();++i) { std::string file_contents; file_id cvs_sha1sum, mtn_sha1sum(i->second->sha1sum); - std::cerr << "checking sync on file: " << i->first << std::endl; + // std::cerr << "checking sync on file: " << i->first; cvs_client::update c=Update(i->first,i->second->cvs_version); - store_checkout(i->second,c,file_contents); - calculate_ident(file_data(file_contents), cvs_sha1sum); + calculate_ident(file_data(c.contents), cvs_sha1sum); I(cvs_sha1sum == mtn_sha1sum); + // std::cerr << " ok" << std::endl; } } ============================================================ --- mtn_cvs/mtn_cvs.cc 76fc48d3793c3695dece4786fa1183dc2d4e61ce +++ mtn_cvs/mtn_cvs.cc 1b248c4fa03423e74aeb98e410319106103fe5b3 @@ -100,7 +100,7 @@ CMD(pull, N_("network"), N_("[CVS-REPOSI // missing: compression level (-z), cvs-branch (-r), since (-D) CMD(pull, N_("network"), N_("[CVS-REPOSITORY CVS-MODULE [CVS-BRANCH]]"), N_("(re-)import a module from a remote cvs repository"), - options::opts::branch | options::opts::since | options::opts::full) + options::opts::branch | options::opts::since | options::opts::full | options::opts::extended_checking) { if (args.size() == 1 || args.size() > 3) throw usage(name); ============================================================ --- mtn_cvs/options_list.hh 3bab48751ad37ca16b591c2fdddbe3689c656809 +++ mtn_cvs/options_list.hh ee5da97b4be16282945d18c99711c7e32a450fd8 @@ -31,6 +31,13 @@ OPT(since, "since", utf8, , N_("set hist } #endif +OPT(extended_checking, "extended-checking", bool, false, N_("run more checks on the mtn/cvs sync state")) +#ifdef option_bodies +{ + extended_checking = true; +} +#endif + OPT(full, "full", bool, false, N_("ignore already pulled CVS revisions")) #ifdef option_bodies {