# # patch "ChangeLog" # from [052abd2ef070306b0c67e388bcea872877d8196c] # to [4107f52fd29ed72a06ec2dddad31431df1c5aff2] # # patch "commands.cc" # from [75481093100bfad9ebc37e00e0eedb053762e4f3] # to [566e18dee0cbeed3439bf5fcb1cc8b4756790a1c] # # patch "tests/t_update_branch.at" # from [248a24155ced3052ff905aa79e43f1fba6bfc136] # to [0ed6d5a93df9833bcf10e4144e5c6d7fa12a147b] # # patch "update.cc" # from [9bc504787033d965ca4258269fd413bfeca2c753] # to [4146a913fb0f38f711d1add3546741bd096cf502] # =============================================== --- ChangeLog 052abd2ef070306b0c67e388bcea872877d8196c +++ ChangeLog 4107f52fd29ed72a06ec2dddad31431df1c5aff2 @@ -1,3 +1,10 @@ +2005-07-28 Nathaniel Smith + + * update.cc (calculate_update_set): Only include current rev in + update set if it is an acceptable candidate. + * commands.cc (update): Clarify error message in this case. + * tests/t_update_branch.at: Update accordingly. + 2005-07-27 Nathaniel Smith * tests/t_update_branch.at: New test. =============================================== --- commands.cc 75481093100bfad9ebc37e00e0eedb053762e4f3 +++ commands.cc 566e18dee0cbeed3439bf5fcb1cc8b4756790a1c @@ -2954,8 +2954,10 @@ { set candidates; pick_update_candidates(r_old_id, app, candidates); - N(candidates.size() != 0, - F("no candidates remain after selection")); + N(!candidates.empty(), + F("your request matches no descendents of the current revision\n" + "in fact, it doesn't even match the current revision\n" + "maybe you want --revision=")); if (candidates.size() != 1) { P(F("multiple update candidates:\n")); =============================================== --- tests/t_update_branch.at 248a24155ced3052ff905aa79e43f1fba6bfc136 +++ tests/t_update_branch.at 0ed6d5a93df9833bcf10e4144e5c6d7fa12a147b @@ -10,7 +10,10 @@ ]) COMMIT(otherbranch) -AT_CHECK(MONOTONE update -b testbranch, [], [ignore], [ignore]) +# This update should fail (because not only does it have no update +# candidate, but it's currently at an off-branch revision); and should +# not update the MT/options +AT_CHECK(MONOTONE update -b testbranch, [1], [ignore], [ignore]) AT_CHECK(grep -q otherbranch MT/options, []) AT_CHECK(grep -q testbranch MT/options, [1]) =============================================== --- update.cc 9bc504787033d965ca4258269fd413bfeca2c753 +++ update.cc 4146a913fb0f38f711d1add3546741bd096cf502 @@ -115,9 +115,11 @@ get_test_results_for_revision(base, base_results, app); candidates.clear(); - // we insert 'base' into the candidate set, because the way we signal 'no - // update necessary' is to return a set containing just it. - candidates.insert(base); + // we possibly insert base into the candidate set as well; returning a set + // containing just it means that we are up to date; returning an empty set + // means that there is no acceptable update. + if (acceptable_descendent(branch, base, base_results, base, app)) + candidates.insert(base); // keep a visited set to avoid repeating work set visited;