Author: zack
Date: 2008-08-08 21:25:16 +0000 (Fri, 08 Aug 2008)
New Revision: 1583

Modified:
   trunk/debian/changelog
   trunk/scripts/bts.pl
Log:
bts: add support for the fake "gift" tag. It is to be used as a shorthand
for the "gift" usertag, see http://wiki.debian.org/qa.debian.org/GiftTag

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-08-07 17:28:59 UTC (rev 1582)
+++ trunk/debian/changelog      2008-08-08 21:25:16 UTC (rev 1583)
@@ -1,10 +1,15 @@
 devscripts (2.10.36) UNRELEASED; urgency=low
 
+  [ Adam D. Barratt ]
   * debsign: When copying .changes files from a remote host, attempt to process
     each copied file if a wildcard was used in the filename (Closes: #491627)
   * tagpending: Fix a typo in the help output. Thanks Thijs Kinkhorst.
     (Closes: #494131)
 
+  [ Stefano Zacchiroli ]
+  * bts: add support for the fake "gift" tag. It is to be used as a shorthand
+    for the "gift" usertag, see http://wiki.debian.org/qa.debian.org/GiftTag
+
  -- Adam D. Barratt <[EMAIL PROTECTED]>  Mon, 28 Jul 2008 20:06:49 +0100
 
 devscripts (2.10.35) unstable; urgency=low

Modified: trunk/scripts/bts.pl
===================================================================
--- trunk/scripts/bts.pl        2008-08-07 17:28:59 UTC (rev 1582)
+++ trunk/scripts/bts.pl        2008-08-08 21:25:16 UTC (rev 1583)
@@ -509,6 +509,7 @@
 my $opt_ccemail = "";
 my $use_default_cc = 1;
 my $ccsecurity="";
+my $gifted = "";
 
 Getopt::Long::Configure('require_order');
 GetOptions("help|h" => \$opt_help,
@@ -1263,6 +1264,12 @@
 
 will remove all tags from the specified bug.
 
+As a special case, the unofficial "gift" tag name is supported in
+addition to official tag names. "gift" is used as a shorthand for the
+gift usertag; see L<http://wiki.debian.org/qa.debian.org/GiftTag>.
+Adding/removing the gift tag will add/remove the gift usertag,
+belonging to the L<[EMAIL PROTECTED]> user.
+
 =cut
 
 sub bts_tags {
@@ -1287,12 +1294,15 @@
        die "bts tags: set what tag?\n";
     }
     
+    my $base_command = $command;
     foreach my $tag (@_) {
        if (exists $valid_tags{$tag}) {
            $command .= " $tag";
            if ($tag eq "security") {
                    $ccsecurity = "[EMAIL PROTECTED]";
            }
+       } elsif ($tag eq "gift") {
+         $gifted = $bug;
        } else {
            # Try prefixes
            my @matches = grep /^\Q$tag\E/, @valid_tags;
@@ -1305,7 +1315,15 @@
            $command .= " $matches[0]";
        }
     }
-    mailbts("tagging $bug", $command);
+    if ($gifted ne "") {
+      my $gift_flag = $flag;
+      $gift_flag = "+" if $gift_flag eq "=";
+      mailbts("gifting $bug",
+       "user [EMAIL PROTECTED] $bug $gift_flag gift");
+    }
+    if ($base_command ne $command) {  # at least one tag other than gift has 
been manipulated
+      mailbts("tagging $bug", $command);
+    }
 }
 
 =item user <email>



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to