# # add_file "tests/t_update_nonexistent.at" # # patch "ChangeLog" # from [13540d1b349bcded256bce2952358c4cac0b9d86] # to [4a9d3e3d72df10d5792c526a70166bed2621e236] # # patch "commands.cc" # from [802ab5385a30de04950cf7dbf99f0b445a248a84] # to [5c5ffeb1c705633a442c8abe9d14ffd03db99869] # # patch "tests/t_update_nonexistent.at" # from [] # to [a7f5255b645f8be25c40d15a62f9f5279bf2aa59] # # patch "testsuite.at" # from [450a36914862e3cdf4485494b25be20b5c6184f3] # to [43031d5d196cfda4496ed11d9f46f448bc973697] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,13 @@ 2005-04-16 Nathaniel Smith + * tests/t_update_nonexistent.at: New test. + * testsuite.at: Add it. + + * commands.cc (update): Verify that user's requested revision + exists. + +2005-04-16 Nathaniel Smith + * ChangeLog: Fixup after merge. 2005-04-16 Emile Snyder --- commands.cc +++ commands.cc @@ -3142,7 +3142,11 @@ r_chosen_id = *(candidates.begin()); } else - complete(app, idx(args, 0)(), r_chosen_id); + { + complete(app, idx(args, 0)(), r_chosen_id); + N(app.db.revision_exists(r_chosen_id), + F("no revision %s found in database") % r_chosen_id); + } if (r_old_id == r_chosen_id) { --- tests/t_update_nonexistent.at +++ tests/t_update_nonexistent.at @@ -0,0 +1,10 @@ +AT_SETUP([update to non-existent rev]) +MONOTONE_SETUP + +ADD_FILE(testfile, [blah blah +]) +COMMIT(testbranch) + +AT_CHECK(MONOTONE update 73070030f7b0d0f3d4ee02545d45ca4bbe5e189f, [1], [ignore], [ignore]) + +AT_CLEANUP --- testsuite.at +++ testsuite.at @@ -560,3 +560,4 @@ m4_include(tests/t_cvsimport2.at) m4_include(tests/t_lf_crlf.at) m4_include(tests/t_add_vs_commit.at) +m4_include(tests/t_update_nonexistent.at)