# # patch "ChangeLog" # from [fb4d3b8051289b3f89106719592dde52ac6c5274] # to [1746ee4a9f2425a09003fbc4c9d16f25c44640e4] # # patch "commands.cc" # from [66074ce5682e04de1bf09b9274d6eee2ad97a872] # to [bae3f75e098e58c2e54eda192c62ac4e4f1847b0] # # patch "tests/t_bad_packets.at" # from [2f4b3f6509ae0d401eff37a7d6a6fae327779a21] # to [8e2ff9cc8d268247ab5471a1ac4548565e814eb5] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,13 @@ 2005-06-05 Nathaniel Smith + * tests/t_bad_packets.at: Expect certs on a non-existent rev to + fail. Run db check instead. + * commands.cc (complete): Let callers specify they're okay with + non-existent revisions. + (CMD(trusted)): So specify. + +2005-06-05 Nathaniel Smith + * tests/t_tags.at: 'tag' on a non-existent revid should fail. * commands.cc (complete): Fail on non-existent revids. --- commands.cc +++ commands.cc @@ -410,7 +410,8 @@ static void complete(app_state & app, string const & str, - revision_id & completion) + revision_id & completion, + bool must_exist=true) { // This copies the start of selectors::parse_selector().to avoid // getting a log when there's no expansion happening...: @@ -421,8 +422,9 @@ && str.size() == constants::idlen) { completion = revision_id(str); - N(app.db.revision_exists(completion), - F("no such revision '%s'") % completion); + if (must_exist) + N(app.db.revision_exists(completion), + F("no such revision '%s'") % completion); return; } @@ -915,7 +917,7 @@ throw usage(name); revision_id rid; - complete(app, idx(args, 0)(), rid); + complete(app, idx(args, 0)(), rid, false); hexenc ident(rid.inner()); cert_name name; --- tests/t_bad_packets.at +++ tests/t_bad_packets.at @@ -9,7 +9,7 @@ AT_CHECK(MONOTONE pubkey address@hidden, [1], [ignore], [ignore]) AT_CHECK(MONOTONE privkey address@hidden, [1], [ignore], [ignore]) -# This one should succeed, but print nothing. -AT_CHECK(MONOTONE certs 73070030f7b0d0f3d4ee02545d45ca4bbe5e189f, [], [], [ignore]) +AT_CHECK(MONOTONE certs 73070030f7b0d0f3d4ee02545d45ca4bbe5e189f, [1], [ignore], [ignore]) +AT_CHECK(MONOTONE db check, [], [ignore], [ignore]) AT_CLEANUP