From 07b5c652ea12cdc4e08b0129c13dcdd21cf972de Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Mon, 5 Mar 2018 15:59:20 -0800 Subject: [PATCH] provide informative information when unarchiving unarchived bugs --- Debbugs/Control.pm | 9 +++++++++ debian/changelog | 2 ++ 2 files changed, 11 insertions(+) diff --git a/Debbugs/Control.pm b/Debbugs/Control.pm index 6b2ab91..1f8b3aa 100644 --- a/Debbugs/Control.pm +++ b/Debbugs/Control.pm @@ -3246,6 +3246,15 @@ sub bug_unarchive { my @bugs = @{$info{bugs}}; my $action = "$config{bug} unarchived."; my @files_to_remove; + ## error out if we're unarchiving unarchived bugs + for my $data (@{$info{data}}) { + if (not defined $data->{archived} or + not $data->{archived} + ) { + __end_control(%info); + croak("Bug $data->{bug_num} was not archived; not unarchiving it."); + } + } for my $bug (@bugs) { print {$debug} "$param{bug} removing $bug\n"; my $dir = get_hashname($bug); diff --git a/debian/changelog b/debian/changelog index 8a91da8..b012c06 100644 --- a/debian/changelog +++ b/debian/changelog @@ -66,6 +66,8 @@ debbugs (2.6.0~exp1) UNRELEASED; urgency=low * Add rel="canonical" links to bug pages (Closes: #890338). Thanks to Chris Lamb. * Fix blocks/blockedby of archived bugs (Closes: #892060). Thanks to Laurent Bigonville. + * Provide informative error message when unarchive fails because the bug is + not archived. (Closes: #892135). Thanks to Dan Jacobson. [ Niels Thykier ] * quitcgi() now returns 400/500 status codes instead of 200 (Closes: #584922) -- 2.39.2