# # # patch "mtn_cvs/cvs_sync.cc" # from [3b24a623e462ab43fddd4876d5180d6d9c73677f] # to [91f59dc1d415e6c2b9bf658f9a820cd397d0cea4] # # patch "mtn_cvs/mtn_automate.cc" # from [95375ee8c341f5f2c4a653039f3f18f483eb9612] # to [e090ae7228ce2c3b752231c4595d5333529d47ab] # # patch "mtn_cvs/mtn_automate.hh" # from [2a08d830f55476e94f640324568ebb3f01f631bc] # to [a9ab7c98d48c21965fdd7e492f4f8402ce83c6a5] # # patch "mtn_cvs/mtn_cvs.cc" # from [48d89badf00216707a83a49a9590272f5a7afa80] # to [595d8cf19bc4500221abe7efde60522cf0c7b845] # ============================================================ --- mtn_cvs/cvs_sync.cc 3b24a623e462ab43fddd4876d5180d6d9c73677f +++ mtn_cvs/cvs_sync.cc 91f59dc1d415e6c2b9bf658f9a820cd397d0cea4 @@ -1213,7 +1213,13 @@ cvs_sync::cvs_repository *cvs_sync::prep mtn_automate::sync_map_t last_sync_info; revision_id lastid; - + if (app.opts.branch_name().empty()) + { + app.opts.branch_name=app.get_option("branch"); + if (!app.opts.branch_name().empty() && app.opts.branch_name()[app.opts.branch_name().size()-1]=='\n') + app.opts.branch_name=app.opts.branch_name().substr(0,app.opts.branch_name().size()-1); + } + N(!app.opts.branch_name().empty(), F("no destination branch specified\n")); { std::string rep,mod,br; // search for module and last revision guess_repository(rep, mod, br, last_sync_info, lastid, app); @@ -1305,17 +1311,14 @@ void cvs_repository::process_sync_info(m fs.cvssha1sum=const_map_access(sync_info,std::make_pair(sp,attr_key(app.opts.domain()+":sha1")))(); fs.keyword_substitution=const_map_access(sync_info,std::make_pair(sp,attr_key(app.opts.domain()+":keywords")))(); - // determine sha1sum of monotone file - mtn_automate::manifest_map::const_iterator fileiter=manifest.find(i->first); - I(fileiter!=manifest.end()); - fs.sha1sum=fileiter->second.first.inner(); + fs.sha1sum=i->second.first.inner(); + if (fs.sha1sum().empty()) continue; // directory node fs.log_msg=e.changelog; fs.author=e.author; std::string path=file_path(i->first).as_internal(); cvs_file_state cfs=remember(files[path].known_states,fs,path); e.xfiles.insert(std::make_pair(path,cfs)); } - piece::reset(); revision_lookup[e.revision]=edges.insert(e).first; #warning do I need this code? #if 0 @@ -1785,7 +1788,7 @@ void cvs_repository::parse_module_paths( } } // how can we know that this is all? - if (sd.empty()) + if (sd.find("")==sd.end()) { sd[""]=root+"/"+module+"/"; } SetServerDir(sd); ============================================================ --- mtn_cvs/mtn_automate.cc 95375ee8c341f5f2c4a653039f3f18f483eb9612 +++ mtn_cvs/mtn_automate.cc e090ae7228ce2c3b752231c4595d5333529d47ab @@ -30,6 +30,11 @@ revision_id mtn_automate::find_newest_sy return revision_id(result); } +std::string mtn_automate::get_option(std::string const& name) +{ + return automate("get_option",std::vector(1,name)); +} + namespace { namespace syms ============================================================ --- mtn_cvs/mtn_automate.hh 2a08d830f55476e94f640324568ebb3f01f631bc +++ mtn_cvs/mtn_automate.hh a9ab7c98d48c21965fdd7e492f4f8402ce83c6a5 @@ -66,6 +66,8 @@ struct mtn_automate : mtn_pipe std::vector get_revision_children(revision_id const& rid); std::vector get_revision_parents(revision_id const& rid); revision_t get_revision(revision_id const& rid); + + std::string get_option(std::string const& name); }; #endif ============================================================ --- mtn_cvs/mtn_cvs.cc 48d89badf00216707a83a49a9590272f5a7afa80 +++ mtn_cvs/mtn_cvs.cc 595d8cf19bc4500221abe7efde60522cf0c7b845 @@ -109,7 +109,6 @@ CMD(pull, N_("network"), N_("[CVS-REPOSI } mtncvs_state &myapp=mtncvs_state::upcast(app); //myapp.dump(); - N(!myapp.opts.branch_name().empty(), F("no destination branch specified\n")); cvs_sync::pull(repository,module,branch,myapp); }