# # # patch "mtn_cvs/CVS_prot" # from [86fca40527b5898c3e721a49ac384af5ad142784] # to [c26ba326a591a2f12361a2a5ddecf77363295662] # # patch "mtn_cvs/cvs_client.cc" # from [634a7c4d2827ef5b12dbe065fef6724a6b4f3dd3] # to [c046e6ff128d45a864ffe02d32ec450ad20ee886] # # patch "mtn_cvs/cvs_client.hh" # from [bd10bec52ff75979a0ca78686c87743561ee38ee] # to [22a09b22fdefb224be0dc9e9e041436708ffdecd] # # patch "mtn_cvs/cvs_sync.cc" # from [4aa8ce3cb6e5d3727103a927eb6c3dc3925ec33c] # to [3b24a623e462ab43fddd4876d5180d6d9c73677f] # ============================================================ --- mtn_cvs/CVS_prot 86fca40527b5898c3e721a49ac384af5ad142784 +++ mtn_cvs/CVS_prot c26ba326a591a2f12361a2a5ddecf77363295662 @@ -117,6 +117,43 @@ ohne -d ohne -d ---- 2005-01-09 00:05:39 +0000 1.1.2.1.2+ XX +------------------- cvs co . ---------------------- +Command-prep checkout +Argument . +Directory . + +expand-modules | Module-expansion . \n ok +Argument -N +Argument -P +Argument -- +Argument . +Directory . + +co | Clear-static-directory ./ \n ./ \n Clear-template ./ \n ./ \n + E cvs checkout: Updating . \n Clear-sticky CVSROOT/ \n CVSROOT/ \n + Clear-static-directory CVSROOT/ \n CVSROOT/ \n + Clear-template CVSROOT/ \n CVSROOT/ \n + E cvs checkout: Updating CVSROOT \n Mod-time 9 Dec 2006 13:37:44 -0000 \n + MT +updated \n MT text U \n MT fname CVSROOT/checkoutlist \n + MT newline \n MT -updated \n Created CVSROOT/ \n CVSROOT/checkoutlist \n + /checkoutlist/1.1/// \n u=rw,g=rw,o=rw \n 495 \n ... + Clear-sticky CVSROOT/ \n CVSROOT/ \n ok + +------------------ cvs add directory ----------------------------------- +Command-prep add +wrapper-sendme-rcsOptions | ok \n +Argument -- +Directory x +x +Directory . + +Argument x +add | Clear-template x/ \n x/ \n + M Directory /tmp/X/x added to the repository \n ok + +(does not harm twice) +-------------------------------------------------------------------------- + ------ Problems: what about the time zone offset when communicating with a CVS server ============================================================ --- mtn_cvs/cvs_client.cc 634a7c4d2827ef5b12dbe065fef6724a6b4f3dd3 +++ mtn_cvs/cvs_client.cc c046e6ff128d45a864ffe02d32ec450ad20ee886 @@ -1566,3 +1566,13 @@ void cvs_client::primeModules() // so reconnect reconnect(); } + +void cvs_client::AddDirectory(std::string const& name, std::string const& _parent) +{ std::string parent=_parent; + if (parent.empty()) parent="."; + if (parent!=".") primeModules(); + else server_dir[""]=module; + Directory(parent!="." ? (parent+"/"+name) : name); + Directory(parent); + SendCommand(std::string("add"),std::vector(1,name)); +} ============================================================ --- mtn_cvs/cvs_client.hh bd10bec52ff75979a0ca78686c87743561ee38ee +++ mtn_cvs/cvs_client.hh 22a09b22fdefb224be0dc9e9e041436708ffdecd @@ -164,6 +164,8 @@ public: std::map > Commit(const std::string &changelog, time_t when, const std::vector &commits); + // parent_path is module relative + void AddDirectory(std::string const& name, std::string const& parent_path); bool CommandValid(const std::string &cmd) const { return Valid_requests.find(cmd)!=Valid_requests.end(); } ============================================================ --- mtn_cvs/cvs_sync.cc 4aa8ce3cb6e5d3727103a927eb6c3dc3925ec33c +++ mtn_cvs/cvs_sync.cc 3b24a623e462ab43fddd4876d5180d6d9c73677f @@ -944,7 +944,14 @@ std::set::iterator cvs_reposit i!=cs->dirs_added.end(); ++i) { std::string name=file_path(*i).as_internal(); L(FL("dir add %s\n") % name); -#warning create directory + + std::string parent,dir=name; + std::string::size_type last_slash=name.rfind('/'); + if (last_slash!=std::string::npos) + { parent=name.substr(0,last_slash); + dir=name.substr(last_slash+1); + } + AddDirectory(dir,parent); } for (std::map::const_iterator