# # # patch "mtn_cvs/cvs_sync.cc" # from [ae9918f30da11915e062e8f8ad15d088bedd25a2] # to [81b63036900bbdaa661baec9fdff77ac502e316a] # # patch "mtn_cvs/cvs_sync.hh" # from [40f5e34d1c5044367e452cfc1941aeba874b9f5c] # to [66c714302eec484930e5231f99d6c7f0496c84e1] # # patch "mtn_cvs/mtn_cvs.cc" # from [44bdaad48768590d68e414239ec73069f2127db1] # to [3ee0f4e50577579414814760364534e9ce4e6bf9] # ============================================================ --- mtn_cvs/cvs_sync.cc ae9918f30da11915e062e8f8ad15d088bedd25a2 +++ mtn_cvs/cvs_sync.cc 81b63036900bbdaa661baec9fdff77ac502e316a @@ -229,6 +229,7 @@ } #endif +#if 0 // 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, std::string &repository, std::string& module, std::string& branch) @@ -258,6 +259,7 @@ decode_base64(c.inner().value, value); parse_cvs_cert_header(value, repository, module, branch); } +#endif std::string cvs_repository::create_cvs_cert_header() const { @@ -335,6 +337,8 @@ if (tag==repo.branch) repo.branch_point[file]=cvs_revision_nr(revision).get_branch_root(); } +static std::string app_signing_key="address@hidden"; + void cvs_repository::prime_log_cb::revision(const std::string &file,time_t checkin_time, const std::string &revision,const std::string &_author, const std::string &dead,const std::string &_message) const @@ -346,7 +350,7 @@ if (override_time!=-1) { checkin_time=override_time; message="initial state for cvs_pull --since"; - author=repo.app.signing_key(); + author=app_signing_key; } std::pair::iterator,bool> iter= i->second.known_states.insert @@ -385,6 +389,7 @@ && changelog < other.changelog); } +#if 0 void cvs_repository::store_contents(const data &dat, hexenc &sha1sum) { calculate_ident(dat,sha1sum); @@ -393,6 +398,7 @@ if (file_id_ticker.get()) ++(*file_id_ticker); } } +#endif static void apply_delta(piece::piece_table &contents, const std::string &patch) { piece::piece_table after; @@ -400,6 +406,7 @@ std::swap(contents,after); } +#if 0 void cvs_repository::store_delta(const std::string &new_contents, const std::string &old_contents, // this argument is unused since we can no longer use the rcs patch @@ -508,6 +515,7 @@ } return false; } +#endif void cvs_repository::check_split(const cvs_file_state &s, const cvs_file_state &end, const std::set::iterator &e) @@ -894,7 +902,7 @@ // FIXME: look for this edge already in the database if (edges.begin()!=edges.end()) root_time=edges.begin()->time-1; std::set::iterator root_edge - =edges.insert(cvs_edge(branch+" branching point",root_time,app.signing_key())).first; + =edges.insert(cvs_edge(branch+" branching point",root_time,app_signing_key)).first; for (std::map::const_iterator i=branch_point.begin();i!=branch_point.end();++i) { file_state fs(root_edge->time,i->second.get_string()); fs.log_msg=root_edge->changelog; @@ -1199,7 +1207,6 @@ fail=true; return edges.end(); } -#endif std::string cvs_repository::gather_merge_information(revision_id const& id) { std::set parents; @@ -1305,7 +1312,6 @@ store_modules(); } -#if 0 // look for _any_ cvs cert in the given monotone branch and assign // its value to repository, module, branch @@ -1426,6 +1432,7 @@ return iter.first; } +#if 0 void cvs_repository::process_certs(const std::vector< revision > &certs) { std::auto_ptr cert_ticker; @@ -1534,6 +1541,7 @@ } if (global_sanity.debug) L(FL("%s") % debug()); } +#endif struct cvs_repository::update_cb : cvs_client::update_callbacks { cvs_repository &repo; @@ -1547,6 +1555,7 @@ } }; +#if 0 void cvs_repository::update() { retrieve_modules(); std::set::iterator now_iter=last_known_revision(); @@ -1647,6 +1656,7 @@ store_modules(); } +#endif static void apply_manifest_delta(cvs_manifest &base,const cvs_manifest &delta) { L(FL("apply_manifest_delta: base %d delta %d\n") % base.size() % delta.size()); @@ -1754,6 +1764,7 @@ server_dir[local]=server; } +#if 0 void cvs_repository::takeover_dir(const std::string &path) { // remember the server path for this subdirectory MM(path); @@ -1876,7 +1887,6 @@ store_modules(); } -#if 0 // read in directory put into db void cvs_sync::takeover(app_state &app, const std::string &_module) { std::string root,module=_module,branch; @@ -1924,7 +1934,6 @@ } catch (...) {} if (oldval()!=value) app.db.set_var(key, value); } -#endif void cvs_repository::retrieve_modules() { if (!GetServerDir().empty()) return; @@ -1951,3 +1960,4 @@ piece::reset(); SetServerDir(sd); } +#endif ============================================================ --- mtn_cvs/cvs_sync.hh 40f5e34d1c5044367e452cfc1941aeba874b9f5c +++ mtn_cvs/cvs_sync.hh 66c714302eec484930e5231f99d6c7f0496c84e1 @@ -12,6 +12,7 @@ //#include "constants.hh" //#include "app_state.hh" //#include "packet.hh" +class app_state; namespace cvs_sync { struct cvs_revision_nr @@ -132,10 +133,10 @@ public: std::string create_cvs_cert_header() const; - static void parse_cvs_cert_header(revision const& c, - std::string &repository, std::string& module, std::string& branch); - static std::string::size_type parse_cvs_cert_header(cert_value const& value, - std::string &repository, std::string& module, std::string& branch); +// static void parse_cvs_cert_header(revision const& c, +// std::string &repository, std::string& module, std::string& branch); +// static std::string::size_type parse_cvs_cert_header(cert_value const& value, +// std::string &repository, std::string& module, std::string& branch); private: void check_split(const cvs_file_state &s, const cvs_file_state &end, @@ -158,7 +159,7 @@ void store_contents(const data &contents, hexenc &sha1sum); void store_delta(const std::string &new_contents, const std::string &old_contents, const std::string &patch, const hexenc &from, hexenc &to); - void cert_cvs(const cvs_edge &e, packet_consumer & pc); +// void cert_cvs(const cvs_edge &e, packet_consumer & pc); cvs_file_state remember(std::set &s,const file_state &fs, cvs_file_path const& filename); void join_edge_parts(std::set::iterator i); std::set::iterator last_known_revision(); @@ -177,7 +178,7 @@ void prime(); void update(); void commit(); - void process_certs(const std::vector< revision > &certs); +// void process_certs(const std::vector< revision > &certs); bool empty() const { return edges.empty() && files.empty(); } const cvs_manifest &get_files(const revision_id &e); ============================================================ --- mtn_cvs/mtn_cvs.cc 44bdaad48768590d68e414239ec73069f2127db1 +++ mtn_cvs/mtn_cvs.cc 3ee0f4e50577579414814760364534e9ce4e6bf9 @@ -1,13 +1,21 @@ // -*- mode: C++; c-file-style: "gnu"; indent-tabs-mode: nil -*- // copyright (C) 2002, 2003 graydon hoare // all rights reserved. // licensed to the public under the terms of the GNU GPL (>= 2) // see the file COPYING for details -#include "config.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "popt/popt.h" - char * argstr = NULL; long arglong = 0; @@ -69,7 +77,7 @@ if (!global_sanity.clean_shutdown) global_sanity.dump_buffer(); - Botan::Init::deinitialize(); +// Botan::Init::deinitialize(); } @@ -119,6 +127,7 @@ poptFreeContext(con); } +#if 0 // Read arguments from a file. The special file '-' means stdin. // Returned value must be free()'d, after arg parsing has completed. static void @@ -154,7 +163,10 @@ free(argv); } +#endif +using namespace std; + static string coption_string(int o) { @@ -180,7 +192,7 @@ // go-go gadget i18n setlocale(LC_ALL, ""); - bindtextdomain(PACKAGE, LOCALEDIR); +// bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); @@ -210,12 +222,12 @@ L(FL("set locale: LC_ALL=%s\n") % locale_string); std::string full_version_string; - get_full_version(full_version_string); - MM(full_version_string); +// get_full_version(full_version_string); +// MM(full_version_string); // Set up secure memory allocation etc - Botan::Init::initialize(); - Botan::set_default_allocator("malloc"); +// Botan::Init::initialize(); +// Botan::set_default_allocator("malloc"); // decode all argv values into a UTF-8 array @@ -240,7 +252,7 @@ // process main program options - int opt; + int opt=-1; bool requested_help = false; set used_local_options; @@ -248,6 +260,7 @@ try { +#if 0 app_state app; app.set_prog_name(prog_name); @@ -269,6 +282,7 @@ break; } } +#endif // verify that there are no errors in the command line @@ -298,7 +312,7 @@ // Certain commands may subsequently require a workspace or fail // if we didn't find one at this point. - app.allow_workspace(); +// app.allow_workspace(); // main options processed, now invoke the // sub-command w/ remaining args @@ -323,7 +337,7 @@ { args.push_back(utf8(string(poptGetArg(ctx())))); } - ret = commands::process(app, cmd, args); +// ret = commands::process(app, cmd, args); } } catch (usage & u)