# # # patch "rcs_import.cc" # from [e77f12752fc0f7d2f684ca45ce8e719edc4b0d5a] # to [bfb657c1c6612082390eb9a00749eda29ea17730] # # patch "tests/importing_cvs_with_multiple_vendor_imports/__driver__.lua" # from [2d582b47b2ec0746a64de9b7d237df685b9108a9] # to [a2a3e3c5966ad13654214cb03f0b52ffb43e1cbf] # ============================================================ --- rcs_import.cc e77f12752fc0f7d2f684ca45ce8e719edc4b0d5a +++ rcs_import.cc bfb657c1c6612082390eb9a00749eda29ea17730 @@ -383,6 +383,24 @@ cvs_history blobs[b->second].push_back(c); return b->second; } + + void split_authorclog(const cvs_authorclog ac, utf8 & author, + utf8 & changelog) + { + string ac_str = authorclog_interner.lookup(ac); + int i = ac_str.find("|||"); + I(i > 0); + + author = utf8(ac_str.substr(0, i)); + changelog = utf8(ac_str.substr(i+4)); + } + + string join_authorclog(const string author, const string clog) + { + I(author.size() > 0); + I(clog.size() > 0); + return author + "|||" + clog; + } }; @@ -685,12 +703,13 @@ process_rcs_branch(string const & begin_ bool alive = delta->second->state != "dead"; - string ac_str = delta->second->author + "|||\n"; - + string ac_str; if (is_synthetic_branch_root) - ac_str += "synthetic branch root changelog"; + ac_str = cvs.join_authorclog(delta->second->author, + "systhetic branch root changelog"); else - ac_str += deltatext->second->log; + ac_str = cvs.join_authorclog(delta->second->author, + deltatext->second->log); L(FL("author and changelog: %s") % ac_str); cvs_authorclog ac = cvs.authorclog_interner.intern(ac_str); @@ -1364,11 +1383,16 @@ class blob_label_writer if (b.get_digest().is_commit()) { + L(FL("blob %d: commit") % v); + //utf8 author, clog; const shared_ptr< cvs_commit > ce = boost::static_pointer_cast(*b.begin()); label = (FL("blob %d: commit") % v).str(); - label += "\\n" + cvs.authorclog_interner.lookup(ce->authorclog); + + // FIXME: won't work because I need to escape... + //cvs.split_authorclog(ce->authorclog, author, clog); + //label += "\\n" + author; label += "\\n\\n"; for (blob_event_iter i = b.begin(); i != b.end(); i++) @@ -1384,6 +1408,8 @@ class blob_label_writer } else if (b.get_digest().is_branch()) { + L(FL("blob %d: branch") % v); + label = (FL("blob %d: branch: ") % v).str(); const shared_ptr< cvs_event_branch > cb = @@ -1393,6 +1419,8 @@ class blob_label_writer } else if (b.get_digest().is_tag()) { + L(FL("blob %d: tag") % v); + label = (FL("blob %d: tag") % v).str(); const shared_ptr< cvs_event_tag > cb = @@ -1620,14 +1648,10 @@ cluster_consumer::store_auxiliary_certs( void cluster_consumer::store_auxiliary_certs(prepared_revision const & p) { - packet_db_writer dbw(app); + utf8 author, changelog; - string ac_str = cvs.authorclog_interner.lookup(p.authorclog); - int i = ac_str.find("|||\n"); - - utf8 author = utf8(ac_str.substr(0, i)); - utf8 changelog = utf8(ac_str.substr(i+4)); - + cvs.split_authorclog(p.authorclog, author, changelog); + packet_db_writer dbw(app); app.get_project().put_standard_certs(p.rid, utf8(branchname), changelog, ============================================================ --- tests/importing_cvs_with_multiple_vendor_imports/__driver__.lua 2d582b47b2ec0746a64de9b7d237df685b9108a9 +++ tests/importing_cvs_with_multiple_vendor_imports/__driver__.lua a2a3e3c5966ad13654214cb03f0b52ffb43e1cbf @@ -34,11 +34,11 @@ check(indir("vendorB_dir", cvs("import", check(indir("vendorB_dir", cvs("import", "-m", "Initial import from VendorA", "-b", "1.1.3", "testsrc", "VendorB", "VendorB_REL_2")), 0, false, false) -- import into monotone and check presence of files -check(mtn("--branch=test", "cvs_import", cvsroot.."/testsrc"), 0, false, false) +check(mtn("--branch=test", "--debug", "cvs_import", cvsroot.."/testsrc"), 0, false, false) -- check if all non-empty branches were imported check(mtn("list", "branches"), 0, true, false) -check(samelines("stdout", {"test", "test.VendorA", "test.VendorB"})) +check(samelines("stdout", {";NONAME", "test", "test.VendorA", "test.VendorB"})) check(mtn("checkout", "--branch=test", "maindir"), 0, false, false) check(samefile("fileA.0", "maindir/fileA"))