# # patch "CVS_prot" # from [b4916b4ac1eefd54e62866706c81f57cca3c14a9] # to [a9b10a02331464a2fae31eb6f40a2681a22f2186] # # patch "cvs_sync.cc" # from [5a4503b4e009e72eca01a36e78852a30d710c62a] # to [c9e93ea6cc72e6effccfff2e09343a5a04895f89] # # patch "cvs_sync.hh" # from [270030573dca415187d07c19a88ca8ee74b7be99] # to [ae192e6a0bf3de1d20afb03ea51e972ad21c3a0c] # ======================================================================== --- CVS_prot b4916b4ac1eefd54e62866706c81f57cca3c14a9 +++ CVS_prot a9b10a02331464a2fae31eb6f40a2681a22f2186 @@ -136,3 +136,5 @@ tests: md5sum failure merge+commit without changes + +enhancement: erase_ancestors will drastically reduce memory footprint ======================================================================== --- cvs_sync.cc 5a4503b4e009e72eca01a36e78852a30d710c62a +++ cvs_sync.cc c9e93ea6cc72e6effccfff2e09343a5a04895f89 @@ -176,6 +176,24 @@ return result; } +std::string cvs_repository::debug_file(std::string const& name) +{ std::map::const_iterator i=files.find(name); + E(i!=files.end(),F("file '%s' not found\n") % name); + std::string result; + for (std::set::const_iterator j=i->second.known_states.begin(); + j!=i->second.known_states.end();++j) + { result+="since "+time_t2human(j->since_when); + result+="V"+j->cvs_version+" "; + if (j->dead) result+= "dead"; + else if (j->size) result+= boost::lexical_cast(j->size); + else if (j->patchsize) result+= "p" + boost::lexical_cast(j->patchsize); + else if (!j->sha1sum().empty()) result+= j->sha1sum().substr(0,4) + j->keyword_substitution; + result+=" "+j->log_msg.substr(0,20)+"\n"; + } + return result; +} + +#if 0 std::string debug_files(const std::map &files) { std::string result; for (std::map::const_iterator i=files.begin(); @@ -196,6 +214,7 @@ } return result; } +#endif // returns the length of the first line (header) and fills in fields std::string::size_type cvs_repository::parse_cvs_cert_header(cert_value const& value, @@ -1604,18 +1623,16 @@ app.db.get_revision_certs(cvs_cert_name, certs); repo.process_certs(certs); std::cout << debug_manifest(repo.get_files(rid)); - return; } - else if (command=="history") + else if (command=="history") // filename or empty { std::string repository, module, branch; - std::vector< revision > certs; guess_repository(repository, module, branch, certs, app); cvs_sync::cvs_repository repo(app,repository,module,branch,false); repo.process_certs(certs); - std::cout << repo.debug(); - return; + if (arg.empty()) std::cout << repo.debug(); + else std::cout << repo.debug_file(arg); } } ======================================================================== --- cvs_sync.hh 270030573dca415187d07c19a88ca8ee74b7be99 +++ cvs_sync.hh ae192e6a0bf3de1d20afb03ea51e972ad21c3a0c @@ -178,6 +178,7 @@ static time_t posix2time_t(std::string s); void takeover(); + std::string debug_file(std::string const& name); public: cvs_repository(app_state &app, const std::string &repository,