# # patch "cvs_client.cc" # from [003c0c91270eb17d49689d611b223831861ee40b] # to [191daf7e6c2764e416730f275a903cf47c8006a4] # # patch "cvs_client.hh" # from [77bdf95ec2ba6503bd3c3ceaa24f931229fa6d72] # to [97c1832578e5c4f30a01d9eeaabf45065fd9dd5f] # # patch "cvs_repository.cc" # from [951f1f6f54cdd2d0c98c46761bc2e41345733b2f] # to [562426cdf624d2c7b72fc379550754fdef93b775] # # patch "tests/t_cvstakeover_modified.at" # from [ae6f3510942f95a0fd7b026b7bddc7571f4da8d4] # to [a3b793f3354d25e72a7ca684dad8ea370eef42c7] # ======================================================================== --- cvs_client.cc 003c0c91270eb17d49689d611b223831861ee40b +++ cvs_client.cc 191daf7e6c2764e416730f275a903cf47c8006a4 @@ -270,8 +270,34 @@ memset(&decompress,0,sizeof decompress); if (do_connect) connect(); + else if (!pserver && host.empty()) host=localhost_name(); } +std::string cvs_client::localhost_name() +{ // get localhost's name + char domainname[1024]; + *domainname=0; +#ifdef WIN32 + strcpy(domainname,"localhost"); // gethostname does not work here ... +#else + if (gethostname(domainname,sizeof domainname)) + throw oops("gethostname "+std::string(strerror(errno))); + domainname[sizeof(domainname)-1]=0; +#endif +#if !defined(__sun) && !defined(WIN32) + unsigned len=strlen(domainname); + if (len && len", 256)); byte_out_ticker.reset(new ticker("bytes out", "<", 256)); @@ -295,31 +321,9 @@ } } else // rsh - { std::string localhost_name; - { // get localhost's name - char domainname[1024]; - *domainname=0; -#ifdef WIN32 - strcpy(domainname,"localhost"); // gethostname does not work here ... -#else - if (gethostname(domainname,sizeof domainname)) - throw oops("gethostname "+std::string(strerror(errno))); - domainname[sizeof(domainname)-1]=0; -#endif -#if !defined(__sun) && !defined(WIN32) - unsigned len=strlen(domainname); - if (len && len args; @@ -347,7 +351,7 @@ args.push_back(host); args.push_back("cvs server"); } - if (host.empty()) host=localhost_name; + if (host.empty()) host=local_name; stream=boost::shared_ptr(new Netxx::PipeStream(cmd,args)); } ======================================================================== --- cvs_client.hh 77bdf95ec2ba6503bd3c3ceaa24f931229fa6d72 +++ cvs_client.hh 97c1832578e5c4f30a01d9eeaabf45065fd9dd5f @@ -135,6 +135,7 @@ std::string host; // for author certification void reconnect(); + static std::string localhost_name(); public: cvs_client(const std::string &repository, const std::string &module, bool connect=true); ~cvs_client(); ======================================================================== --- cvs_repository.cc 951f1f6f54cdd2d0c98c46761bc2e41345733b2f +++ cvs_repository.cc 562426cdf624d2c7b72fc379550754fdef93b775 @@ -1840,33 +1840,9 @@ // commit them all commit_revisions(edges.begin()); // create a MT directory -// std::cerr << repo.debug() << '\n'; -// I(!mkdir("MT",0777)); -// app.create_working_copy("."); -// app.write_options(); app.create_working_copy(system_path(".")); -#if 0 - local_path mt(app.book_keeping_dir); - - N(!directory_exists(mt), - F("monotone book-keeping directory '%s' already exists in '%s'\n") - % app.book_keeping_dir % "."); - - L(F("creating book-keeping directory '%s' for working copy in '%s'\n") - % app.book_keeping_dir % "."); - - mkdir_p(mt); - -// make_branch_sticky(); - - app.write_options(); - - app.blank_user_log(); - - if (app.lua.hook_use_inodeprints()) - app.enable_inodeprints(); -#endif - // like in commit + +// like in commit ? // update_any_attrs(app); put_revision_id((--edges.end())->revision); // maybe_update_inodeprints(app); ======================================================================== --- tests/t_cvstakeover_modified.at ae6f3510942f95a0fd7b026b7bddc7571f4da8d4 +++ tests/t_cvstakeover_modified.at a3b793f3354d25e72a7ca684dad8ea370eef42c7 @@ -47,7 +47,6 @@ ######## # check presence of files -AT_CHECK(MONOTONE automate get_file $TSHA0, [], [ignore]) AT_CHECK(MONOTONE automate get_file $TSHA1, [], [ignore]) AT_CHECK(MONOTONE automate get_file $TSHA2, [], [ignore])