The following commit has been merged in the master branch:
commit ef9e146e72620242ada7d75a94de34424e0a9d57
Author: James McCoy <[email protected]>
Date: Wed Jan 18 20:27:17 2012 -0500
bts: Only the first usertags modifier (+/-/=) is relevant.
Partially reverted commit 4456ccc642b7773eed55df751c1681eb5a93e75d.
Signed-off-by: James McCoy <[email protected]>
diff --git a/debian/changelog b/debian/changelog
index 8809dbd..243e1d2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+devscripts (2.11.4) UNRELEASED; urgency=low
+
+ * bts: Revert usertags' handling of more than one +/-/=. Only the first one
+ is relevant.
+
+ -- James McCoy <[email protected]> Wed, 18 Jan 2012 20:25:01 -0500
+
devscripts (2.11.3) unstable; urgency=low
[ Adam D. Barratt ]
diff --git a/scripts/bts.pl b/scripts/bts.pl
index dab399f..068eede 100755
--- a/scripts/bts.pl
+++ b/scripts/bts.pl
@@ -1671,49 +1671,24 @@ sub bts_usertags {
die "bts usertags: set what user tag?\n";
}
# Parse the rest of the command line.
- my $base_command="usertags $bug";
- my $commands = [];
-
- my $curop;
- foreach my $tag (@_) {
- if ($tag =~ s/^([-+=])//) {
- my $op = $1;
- if ($op eq '=') {
- $curop = '=';
- $commands = [];
- }
- elsif (!$curop || $curop ne $op) {
- $curop = $op;
- }
- next unless $tag;
- }
- if (!$curop) {
- $curop = '+';
- }
- if (!@$commands || $curop ne $commands->[-1]{op}) {
- push(@$commands, { op => $curop, tags => [] });
- }
- if ($tag !~ m/^[-[:alnum:]@.+]+$/i) {
- die "bts usertag: \"$tag\" contains characters other than " .
- "alpha-numerics, '\@', '.', '+', and '-'.\n";
- }
- push(@{$commands->[-1]{tags}}, $tag);
+ my $command="usertags $bug";
+ my $flag="";
+ if ($_[0] =~ /^[-+=]$/) {
+ $flag = $_[0];
+ $command .= " $flag";
+ shift;
+ } elsif ($_[0] =~ s/^([-+=])//) {
+ $flag = $1;
+ $command .= " $flag";
}
- my $command = '';
- foreach my $cmd (@$commands) {
- if ($cmd->{op} ne '=' && !@{$cmd->{tags}}) {
- die "bts usertags: set what tag?\n";
- }
- $command .= " $cmd->{op} " . join(' ', @{$cmd->{tags}});
- }
- if (!$command && $curop eq '=') {
- $command = " $curop";
+ if (! @_) {
+ die "bts usertags: set what user tag?\n";
}
- if ($command) {
- mailbts("usertagging $bug", $base_command . $command);
- }
+ $command .= sprintf(' %s', join(' ', @_));
+
+ mailbts("usertagging $bug", $command);
}
=item B<claim> I<bug> [I<claim>]
--
Git repository for devscripts
--
To unsubscribe, send mail to [email protected].