# # # patch "mtn_cvs/cvs_sync.cc" # from [15a1ef98e4a867bf220a52b03a77910da82bfaa4] # to [25bfc31a4f3e3512d38a9532169869ddf010b5ba] # # patch "mtn_cvs/mtn_cvs.cc" # from [4e888ba0151a42bc241e31b526ac7346144f69c4] # to [bbf97edf525a23194fae9a59bce8f6a37f378549] # ============================================================ --- mtn_cvs/cvs_sync.cc 15a1ef98e4a867bf220a52b03a77910da82bfaa4 +++ mtn_cvs/cvs_sync.cc 25bfc31a4f3e3512d38a9532169869ddf010b5ba @@ -588,6 +588,7 @@ file_id cvs_repository::attach_sync_stat file_id cvs_repository::attach_sync_state(cvs_edge & e,mtn_automate::manifest_map const& oldmanifest) { std::string state=create_sync_state(e); + if (state.empty()) return file_id(); // locally changed CVS tree state std::string syncname=".mtn-sync-"+app.domain(); mtn_automate::manifest_map::const_iterator it=oldmanifest.find(file_path_internal(syncname)); file_id fid; @@ -616,12 +617,15 @@ std::string cvs_repository::create_sync_ state+="#files\n"; for (cvs_manifest::const_iterator i=e.xfiles.begin(); i!=e.xfiles.end(); ++i) - { I(!i->second->cvs_version.empty()); -#if 0 + { +#if 1 + if (i->second->cvs_version.empty()) { W(F("blocking attempt to certify an empty CVS revision\n" "(this is normal for a cvs_takeover of a locally modified tree)\n")); - return; + return std::string(); } +#else + I(!i->second->cvs_version.empty()); #endif state+=i->second->cvs_version; if (!i->second->keyword_substitution.empty()) @@ -1615,7 +1619,8 @@ void cvs_repository::takeover() } void cvs_repository::takeover() -{ takeover_dir(""); +{ app.open(); + takeover_dir(""); bool need_second=false; cvs_edge e1,e2; @@ -1649,7 +1654,9 @@ void cvs_repository::takeover() } // commit them all commit_cvs2mtn(edges.begin()); - // create a MT directory + + app.close(); + // now we initialize the workspace // mtn setup . { std::vector args; args.push_back(app.mtn_binary()); ============================================================ --- mtn_cvs/mtn_cvs.cc 4e888ba0151a42bc241e31b526ac7346144f69c4 +++ mtn_cvs/mtn_cvs.cc bbf97edf525a23194fae9a59bce8f6a37f378549 @@ -136,8 +136,8 @@ CMD(takeover, N_("working copy"), N_("[C if (args.size() > 1) throw usage(name); std::string module; if (args.size() == 1) module = idx(args, 0)(); - N(!app.branch_name().empty(), F("no destination branch specified\n")); mtncvs_state &myapp=mtncvs_state::upcast(app); + N(!myapp.branch().empty(), F("no destination branch specified\n")); cvs_sync::takeover(myapp, module); }