# # # patch "NEWS" # from [8cc26e9285718a25c48f203f95b6a56652c5c0f1] # to [f0451ac63f4685bad1d2d41f78007d68e0ae1700] # # patch "cmd_diff_log.cc" # from [5e5c21fdce653b9ed94bf91aa5c3a5dc3c9478aa] # to [8c27f54076677b08a5d7ca1b7e0b01de7d81f2b0] # ============================================================ --- NEWS 8cc26e9285718a25c48f203f95b6a56652c5c0f1 +++ NEWS f0451ac63f4685bad1d2d41f78007d68e0ae1700 @@ -70,6 +70,13 @@ restrict revisions printed to those touching specific paths. Log now allows these options and uses them properly. + - Performance of the log command has been improved significantly. + Previous versions of monotone loaded individual certs by name for each + printed revision and this caused sqlite to not use the correct + index. Now, all certs are loaded for each printed revision once and + individual certs are selected from the full list which allows sqlite + to use the preferred index. + - The update command previously did not clear execute permissions from files that had their associated 'mtn:execute' attribute cleared. ============================================================ --- cmd_diff_log.cc 5e5c21fdce653b9ed94bf91aa5c3a5dc3c9478aa +++ cmd_diff_log.cc 8c27f54076677b08a5d7ca1b7e0b01de7d81f2b0 @@ -585,45 +585,46 @@ static void static void -log_certs(project_t & project, ostream & os, revision_id id, cert_name name, +log_certs(vector const & certs, ostream & os, revision_id id, cert_name name, string label, string separator, bool multiline, bool newline) { - vector certs; bool first = true; if (multiline) newline = true; - project.get_revision_certs_by_name(id, name, certs); for (vector::const_iterator i = certs.begin(); i != certs.end(); ++i) { - if (first) - os << label; - else - os << separator; + if (i->name == name) + { + if (first) + os << label; + else + os << separator; - if (multiline) - os << "\n\n"; - os << i->value; - if (newline) - os << '\n'; + if (multiline) + os << "\n\n"; + os << i->value; + if (newline) + os << '\n'; - first = false; + first = false; + } } } static void -log_certs(project_t & project, ostream & os, revision_id id, cert_name name, +log_certs(vector const & certs, ostream & os, revision_id id, cert_name name, string label, bool multiline) { - log_certs(project, os, id, name, label, label, multiline, true); + log_certs(certs, os, id, name, label, label, multiline, true); } static void -log_certs(project_t & project, ostream & os, revision_id id, cert_name name) +log_certs(vector const & certs, ostream & os, revision_id id, cert_name name) { - log_certs(project, os, id, name, " ", ",", false, false); + log_certs(certs, os, id, name, " ", ",", false, false); } enum log_direction { log_forward, log_reverse }; @@ -976,20 +977,23 @@ CMD(log, "log", "", CMD_REF(informative) if (print_this) { + vector certs; + project.get_revision_certs(rid, certs); + ostringstream out; if (app.opts.brief) { out << rid; - log_certs(project, out, rid, author_name); + log_certs(certs, out, rid, author_name); if (app.opts.no_graph) - log_certs(project, out, rid, date_name); + log_certs(certs, out, rid, date_name); else { out << '\n'; - log_certs(project, out, rid, date_name, + log_certs(certs, out, rid, date_name, string(), string(), false, false); } - log_certs(project, out, rid, branch_name); + log_certs(certs, out, rid, branch_name); out << '\n'; } else @@ -1012,10 +1016,10 @@ CMD(log, "log", "", CMD_REF(informative) anc != ancestors.end(); ++anc) out << "Ancestor: " << *anc << '\n'; - log_certs(project, out, rid, author_name, "Author: ", false); - log_certs(project, out, rid, date_name, "Date: ", false); - log_certs(project, out, rid, branch_name, "Branch: ", false); - log_certs(project, out, rid, tag_name, "Tag: ", false); + log_certs(certs, out, rid, author_name, "Author: ", false); + log_certs(certs, out, rid, date_name, "Date: ", false); + log_certs(certs, out, rid, branch_name, "Branch: ", false); + log_certs(certs, out, rid, tag_name, "Tag: ", false); if (!app.opts.no_files && !csum.cs.empty()) { @@ -1024,8 +1028,8 @@ CMD(log, "log", "", CMD_REF(informative) out << '\n'; } - log_certs(project, out, rid, changelog_name, "ChangeLog: ", true); - log_certs(project, out, rid, comment_name, "Comments: ", true); + log_certs(certs, out, rid, changelog_name, "ChangeLog: ", true); + log_certs(certs, out, rid, comment_name, "Comments: ", true); } if (app.opts.diffs)