]> git.donarmstrong.com Git - debbugs.git/commitdiff
provide informative information when unarchiving unarchived bugs
authorDon Armstrong <don@donarmstrong.com>
Mon, 5 Mar 2018 23:59:20 +0000 (15:59 -0800)
committerDon Armstrong <don@donarmstrong.com>
Mon, 5 Mar 2018 23:59:20 +0000 (15:59 -0800)
Debbugs/Control.pm
debian/changelog

index 6b2ab9181025df9663719c9b5f9ce612362b8504..1f8b3aac60d3cb98fe5264795fc7806e795c4bac 100644 (file)
@@ -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);
index 8a91da82361d7a10755cd83c41474351080d8d1e..b012c06bd75a49ac43c360751718da8e40559f49 100644 (file)
@@ -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)