# # patch "cvs_client.cc" # from [acd768576cf34f95f0302f4e8a276f3a7c758f7e] # to [945483d3281a16fdc405af9f36585ba8018b5a11] # # patch "cvs_sync.cc" # from [39df4f0a0ecd6112bc326acfe6b5284a8af35636] # to [840075f2b481029bd96f0305668fa95bb4f72537] # ======================================================================== --- cvs_client.cc acd768576cf34f95f0302f4e8a276f3a7c758f7e +++ cvs_client.cc 945483d3281a16fdc405af9f36585ba8018b5a11 @@ -279,6 +279,7 @@ writestr("valid-requests\n"); std::string answer=readline(); + MM(answer); I(begins_with(answer,"Valid-requests ")); // boost::tokenizer does not provide the needed functionality (e.g. preserve -) push_back2insert adaptor(Valid_requests); @@ -349,6 +350,7 @@ std::list active_tags; loop: std::string x=readline(); + MM(x); unsigned len=0; if (x.size()<2) goto error; if (begins_with(x,"E ",len)) @@ -493,6 +495,7 @@ static time_t cvs111date2time_t(const std::string &t) { // 2000/11/10 14:43:25 + MM(t); E(t.size()==19, F("cvs111date2time_t unknown format '%s'\n") % t); I(t[4]=='/' && t[7]=='/'); I(t[10]==' ' && t[13]==':'); @@ -511,6 +514,7 @@ static time_t rls_l2time_t(const std::string &t) { // 2003-11-26 09:20:57 +0000 + MM(t); E(t.size()==25, F("rls_l2time_t unknown format '%s'\n") % t); I(t[4]=='-' && t[7]=='-'); I(t[10]==' ' && t[13]==':'); @@ -539,7 +543,8 @@ // Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec // Apr,Aug,Dec,Feb,Jan,Jul,Jun,Mar,May,Nov,Oct,Sep static time_t monname2month(const std::string &x) -{ I(x.size()==3); +{ MM(x); + I(x.size()==3); // I hope this will never get internationalized if (x[0]=='O') return 10; if (x[0]=='S') return 9; @@ -555,6 +560,7 @@ static time_t mod_time2time_t(const std::string &t) { std::vector parts; + MM(t); stringtok(parts,t); I(parts.size()==5); struct tm tm; @@ -573,7 +579,8 @@ } time_t cvs_client::Entries2time_t(const std::string &t) -{ I(t.size()==24); +{ MM(t); + I(t.size()==24); I(t[3]==' '); I(t[7]==' '); std::vector parts; @@ -609,7 +616,8 @@ } void cvs_client::Directory(const std::string &path) -{ if (path.empty() || path==".") // ??? +{ MM(path); + if (path.empty() || path==".") // ??? { std::map::const_iterator i=server_dir.find(""); I(i!=server_dir.end()); writestr("Directory .\n"+i->second+"\n"); @@ -644,7 +652,8 @@ enum { st_dir, st_file } state=st_dir; std::string directory; while (fetch_result(lresult)) - { switch(state) + { L(F("result %s\n") % combine_result(lresult)); + switch(state) { case st_dir: { std::string result=combine_result(lresult); I(result.size()>=2); @@ -780,6 +789,8 @@ {reswitch: L(F("state %d\n") % int(state)); I(!lresult.empty()); + MM(lresult[0].first); + MM(lresult[0].second); E(lresult[0].first!="CMD" || lresult[0].second!="error", F("log failed")); switch(state) { case st_head: @@ -912,6 +923,8 @@ { primeModules(); std::string file=_file; struct checkout result; + MM(file); + MM(revision); // Directory(""); std::string usemodule=module; { std::map::reverse_iterator i; @@ -1248,6 +1261,7 @@ void cvs_client::parse_entry(const std::string &line, std::string &new_revision, std::string &keyword_substitution) { + MM(line); std::vector parts; stringtok(parts,line,"/"); // empty last part will not get created ======================================================================== --- cvs_sync.cc 39df4f0a0ecd6112bc326acfe6b5284a8af35636 +++ cvs_sync.cc 840075f2b481029bd96f0305668fa95bb4f72537 @@ -316,6 +316,7 @@ std::string::size_type cvs_repository::parse_cvs_cert_header(cert_value const& value, std::string &repository, std::string& module, std::string& branch) { + MM(value()); std::string::size_type nlpos=value().find('\n'); I(nlpos!=std::string::npos); std::string repo=value().substr(0,nlpos); @@ -409,7 +410,9 @@ void cvs_repository::prime_log_cb::tag(const std::string &file,const std::string &tag, const std::string &revision) const -{ I(i->first==file); +{ MM(file); + MM(tag); + I(i->first==file); std::map &tagslot=repo.tags[tag]; tagslot[file]=revision; } @@ -560,11 +563,14 @@ { cvs_file_state s2=s; ++s2; if (s2==end) return; + MM(s->since_when); + MM(s2->since_when); I(s->since_when!=s2->since_when); // checkins must not overlap (next revision must lie beyond edge) if ((*s2) <= (*e)) { W(F("splitting edge %ld-%ld at %ld\n") % e->time % e->time2 % s2->since_when); cvs_edge new_edge=*e; + MM(e->time); I(s2->since_when-1>=e->time); e->time2=s2->since_when-1; new_edge.time=s2->since_when; @@ -578,6 +584,10 @@ j++; // next one if (j==edges.end()) break; + MM(j->time2); + MM(j->time); + MM(i->time2); + MM(i->time); I(j->time2==j->time); // make sure we only do this once I(i->time2<=j->time); // should be sorted ... if (!i->similar_enough(*j)) @@ -648,6 +658,9 @@ std::string &contents) { cvs_revision_nr srev(s->cvs_version); + MM(file); + MM(s->cvs_version); + MM(s2->cvs_version); I(srev.is_parent_of(s2->cvs_version)); if (s->dead) { @@ -883,6 +896,7 @@ cvs_edges_ticker.reset(new ticker("edges", "E", 10)); for (std::map::iterator i=files.begin();i!=files.end();++i) { std::vector args; + MM(i->first); if (!branch.empty()) args.push_back("-r"+branch); @@ -909,6 +923,8 @@ { if (i->changelog_valid || i->author.size()) { ++i; continue; } std::set::iterator j=i; j++; + MM(i->time); + MM(j->time); I(j!=edges.end()); I(j->time==i->time); I(i->xfiles.empty()); @@ -923,6 +939,7 @@ // get the contents for (std::map::iterator i=files.begin();i!=files.end();++i) { std::string file_contents; + MM(i->first); I(!branch.empty() || !i->second.known_states.empty()); if (!i->second.known_states.empty()) { std::set::iterator s2=i->second.known_states.begin(); @@ -1543,13 +1560,8 @@ { last=f->second.known_states.begin(); I(last!=f->second.known_states.end()); std::set::iterator s2=last; -#if 0 - cvs_client::checkout c=CheckOut2(i->file,s2->cvs_version); - store_checkout(s2,c,file_contents); -#else cvs_client::update c=Update(i->file,s2->cvs_version); store_checkout(s2,c,file_contents); -#endif } else { I(!last->sha1sum().empty()); @@ -1686,6 +1698,7 @@ void cvs_repository::takeover_dir(const std::string &path) { // remember the server path for this subdirectory + MM(path); { std::string repository; std::ifstream cvs_repository((path+"CVS/Repository").c_str()); N(cvs_repository.good(), F("can't open %sCVS/Repository\n") % path); @@ -1705,6 +1718,7 @@ if (!cvs_Entries.good()) break; if (!line.empty()) { std::vector parts; + MM(line); stringtok(parts,line,"/"); // empty last part will not get created if (parts.size()==5) parts.push_back(std::string()); @@ -1813,6 +1827,7 @@ { fstream cvs_branch("CVS/Tag"); if (cvs_branch.good()) { std::getline(cvs_branch,branch); + MM(branch); I(!branch.empty()); I(branch[0]=='T'); branch.erase(0,1); @@ -1861,6 +1876,7 @@ index_deltatext(value_s,pieces); for (std::vector::const_iterator p=pieces.begin();p!=pieces.end();++p) { std::string line=**p; + MM(line); I(!line.empty()); std::string::size_type tab=line.find('\t'); I(tab!=std::string::npos);