]> git.donarmstrong.com Git - debbugs.git/commitdiff
support -done being set in a psuedoheader don/done_psuedoheader
authorDon Armstrong <don@donarmstrong.com>
Fri, 14 Feb 2020 03:22:52 +0000 (19:22 -0800)
committerDon Armstrong <don@donarmstrong.com>
Fri, 14 Feb 2020 03:22:52 +0000 (19:22 -0800)
debian/changelog
scripts/process
t/06_mail_handling.t

index 4fcec4d4c6b0b4b70e759d26fda8361fa49a7d93..acb7d12e5369e5edc802861ae6d7ce3ea6865d91 100644 (file)
@@ -2,6 +2,7 @@ debbugs (3.0.0~alpha.1) unstable; urgency=medium
 
   * Use Text::Xslate instead of Text::Template; Text::Xslate is significantly
     faster.
+  * Add support for a Done: psuedoheader (closes: #950133)
 
  -- Don Armstrong <don@debian.org>  Fri, 09 Mar 2018 11:17:10 -0800
 
index 3da8f983c4a13ea773fe808a6f8136018b918a9d..265bd5835b6fb2f96e671fef5895cd409b7401c4 100755 (executable)
@@ -241,7 +241,7 @@ for my $phline (@bodylines)
        push @control_bits,$fv;
     } else {
        # Don't lc owner or forwarded
-       $fv = lc $fv unless $fn =~ /^(?:owner|forwarded|usertags|version|source-version)$/;
+       $fv = lc $fv unless $fn =~ /^(?:owner|forwarded|usertags|version|source-version|done)$/;
        $pheader{$fn} = $fv;
     }
     print {$debugfh} ">$fn~$fv<\n";
@@ -390,7 +390,7 @@ if ($codeletter eq 'D' || $codeletter eq 'F')
         }
         $receivedat= "done\@$gEmailDomain";
         $markaswhat= 'done';
-        $set_done= $header{'from'};
+        $set_done= $pheader{'done'} // $header{'from'};
        if ( length( $gListDomain ) > 0 && length( $gDoneList ) > 0 ) {
             $generalcc= "$gDoneList\@$gListDomain";
            push @generalcc, "$gDoneList\@$gListDomain";
index 0e42ed03f5ea1e97972c13507be19269c6db3e9a..2f8f452d7983c98431b5f258f7867fbe72506a10 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: cperl;-*-
 # $Id: 05_mail.t,v 1.1 2005/08/17 21:46:17 don Exp $
 
-use Test::More tests => 126;
+use Test::More tests => 127;
 
 use warnings;
 use strict;
@@ -113,6 +113,22 @@ my $status = read_bug(bug=>1);
 ok($status->{subject} eq 'new title','bug 1 retitled');
 ok($status->{severity} eq 'wishlist','bug 1 wishlisted');
 
+# now check to see if we can close a bug using a psuedoheader done
+send_message(to => '1-done@bugs.something',
+            headers => [To   => 'control@bugs.something',
+                        From => 'foo@bugs.something',
+                        Subject => 'Munging a bug',
+                       ],
+            body => <<'EOF') or fail 'message to control@bugs.something failed';
+Done: Me Developer <me@bugs.something>
+
+I'm closing this bug for reasons
+EOF
+
+$status = read_bug(bug=>1);
+ok($status->{done} eq 'Me Developer <me@bugs.something>');
+
+
 # now we're going to go through and methododically test all of the control commands.
 my @control_commands =
      (