# # # patch "options_list.hh" # from [54ee12e3dfb608ca3a4b9a64cc51a845fc4a0501] # to [031ddc60f940a37d827123f9f8963cf8a233a33a] # # patch "project.cc" # from [42bcaef19ba936f2c0f40da3ceaf005b48b984c6] # to [e36cabaeb25304c08435a3a8aa1ab9c22ed820a7] # # patch "tests/suspend/__driver__.lua" # from [74d515cc0b4792711c198721cd86484b5c9de55a] # to [abfe00e901c6b421535de734ef4725027e1ba49a] # # patch "update.cc" # from [1156e90e7af700ce1b0b3ea7f2bc21c2a3915380] # to [bc9c39135d1e082cf2c4dfbe425ef08e6013ffc4] # ============================================================ --- options_list.hh 54ee12e3dfb608ca3a4b9a64cc51a845fc4a0501 +++ options_list.hh 031ddc60f940a37d827123f9f8963cf8a233a33a @@ -282,6 +282,15 @@ OPTION(include, include, true, "include" } #endif +GOPT(ignore_suspend_certs, "ignore_suspend_certs", bool, false, + gettext_noop("Do not ignore revisions marked as suspended")) +#ifdef option_bodies +{ + ignore_suspend_certs = true; +} +#endif + + OPTVAR(key, rsa_keypair_id, signing_key, ) OPTION(globals, key, true, "key,k", gettext_noop("set key for signatures")) #ifdef option_bodies ============================================================ --- project.cc 42bcaef19ba936f2c0f40da3ceaf005b48b984c6 +++ project.cc e36cabaeb25304c08435a3a8aa1ab9c22ed820a7 @@ -125,10 +125,13 @@ project_t::get_branch_heads(branch_name not_in_branch p(app, branch_encoded); erase_ancestors_and_failures(branch.second, p, app); - suspended_in_branch s(app, branch_encoded); - for(std::set::iterator it = branch.second.begin(); it != branch.second.end(); it++) - if (s(*it)) - branch.second.erase(*it); + if (!app.opts.ignore_suspend_certs) + { + suspended_in_branch s(app, branch_encoded); + for(std::set::iterator it = branch.second.begin(); it != branch.second.end(); it++) + if (s(*it)) + branch.second.erase(*it); + } L(FL("found heads of branch %s (%s heads)") % name % branch.second.size()); ============================================================ --- tests/suspend/__driver__.lua 74d515cc0b4792711c198721cd86484b5c9de55a +++ tests/suspend/__driver__.lua abfe00e901c6b421535de734ef4725027e1ba49a @@ -15,6 +15,12 @@ selmap("h:testbranch", {}) check(mtn("suspend", REV2)) selmap("h:testbranch", {}) +check(mtn("automate", "heads"), 0, true, false) +check(samelines("stdout", {})) + +check(mtn("automate", "heads", "--ignore_suspend_certs"), 0, true, false) +check(samelines("stdout", {REV2})) + -- but still allows children to be committed writefile("testfile", "testbranch3") @@ -69,6 +75,12 @@ check(base_revision() == OREV2b) check(mtn("up"), 0, false, false) check(base_revision() == OREV2b) +-- Check that update complains in that case if we're ignoring suspend certs + +check(mtn("up", "-r", OREV1, "-b", "otherbranch"), 0, false, false) +check(mtn("up", "--ignore_suspend_certs"), 1, false, false) +check(base_revision() == OREV1) + -- Check that update complains about multiple heads when all candidates are suspended check(mtn("suspend", OREV2b)) @@ -76,3 +88,11 @@ check(base_revision() == OREV1) check(mtn("up"), 1, false, false) check(base_revision() == OREV1) +-- check that the --ignore-suspend option works for listing branches + +check(mtn("ls", "branches"), 0, true, true) +check(samelines("stdout", {"testbranch"})) + +check(mtn("ls", "branches", "--ignore_suspend_certs"), 0, true, true) +check(samelines("stdout", {"otherbranch", "testbranch"})) + ============================================================ --- update.cc 1156e90e7af700ce1b0b3ea7f2bc21c2a3915380 +++ update.cc bc9c39135d1e082cf2c4dfbe425ef08e6013ffc4 @@ -185,7 +185,7 @@ calculate_update_set(revision_id const & break; } } - if (have_non_suspended_rev) + if (!app.opts.ignore_suspend_certs && have_non_suspended_rev) { // remove all suspended revisions base64 branch_encoded;