# # patch "cvs_client.cc" # from [7e1129f5756ae3f4309b54dbc7674d58f91c31a7] # to [d785fb286e960d0556f77405e1ea7e9e4d66b205] # # patch "cvs_client.hh" # from [a126f6ae155fccaf112c204428d9afc4e1329acc] # to [edf1ddd8b381989b2a36b3697570c3416b66e60c] # # patch "cvs_repository.cc" # from [5eea25a6a65b2b1151b6b33e1db51361adfc3a2d] # to [35bf77bd26b85c54139d760c17455ca119d5a07c] # # patch "cvs_sync.hh" # from [76440c40c5e7a65035c98886b4b159599ef6cdc5] # to [f6ec0b947d1b9b00c183816771f0e06f3cad0205] # --- cvs_client.cc +++ cvs_client.cc @@ -1280,6 +1280,8 @@ } // cater for encountered bugs ... +// actually this code should not be necessary with the current options +// without -C some revisions interacted with each other badly for (std::vector::const_iterator i=bugged.begin(); i!=bugged.end();++i) { result=update(); --- cvs_client.hh +++ cvs_client.hh @@ -95,7 +95,6 @@ void connect(); void primeModules(); void Log_internal(const rlog_callbacks &cb,const std::string &file,va_list ap); - void reconnect(); void writestr(const std::string &s, bool flush=false); std::string readline(); @@ -128,6 +127,7 @@ // std::string rcs_root; // the real directory of the root (ask cvs.gnome.org) std::string host; // for author certification + void reconnect(); public: cvs_client(const std::string &repository, const std::string &module, bool connect=true); ~cvs_client(); --- cvs_repository.cc +++ cvs_repository.cc @@ -632,7 +632,7 @@ cvs_revision_nr srev(s->cvs_version); I(srev.is_parent_of(s2->cvs_version)); if (s->dead) - { cvs_client::checkout c=CheckOut(file,s2->cvs_version); + { cvs_client::checkout c=CheckOut2(file,s2->cvs_version); I(!c.dead); // dead->dead is no change, so shouldn't get a number I(!s2->dead); // I(s2->since_when==c.mod_time); @@ -867,7 +867,7 @@ { std::string file_contents; I(!i->second.known_states.empty()); { std::set::iterator s2=i->second.known_states.begin(); - cvs_client::checkout c=CheckOut(i->first,s2->cvs_version); + cvs_client::checkout c=CheckOut2(i->first,s2->cvs_version); store_checkout(s2,c,file_contents); } for (std::set::iterator s=i->second.known_states.begin(); @@ -1422,7 +1422,7 @@ { last=f->second.known_states.begin(); I(last!=f->second.known_states.end()); std::set::iterator s2=last; - cvs_client::checkout c=CheckOut(i->file,s2->cvs_version); + cvs_client::checkout c=CheckOut2(i->file,s2->cvs_version); store_checkout(s2,c,file_contents); } else @@ -1556,3 +1556,13 @@ I(cache_item!=revision_lookup.end()); return get_files(*(cache_item->second)); } + +struct checkout cvs_repository::CheckOut2(const std::string &file, const std::string &revision) +{ try + { return CheckOut(file,revision); + } catch (oops &e) + { W(F("trying to reconnect, perhaps the server is confused\n")); + reconnect(); + return CheckOut(file,revision); + } +} --- cvs_sync.hh +++ cvs_sync.hh @@ -144,6 +144,8 @@ std::set::iterator commit( std::set::iterator parent, const revision_id &rid, bool &fail); const cvs_manifest &get_files(const cvs_edge &e); + // try harder (reconnect if something goes wrong) + struct checkout CheckOut2(const std::string &file, const std::string &revision); public: // semi public interface for push/pull void prime();