Author: adsb
Date: 2008-11-16 19:43:18 +0000 (Sun, 16 Nov 2008)
New Revision: 1726

Modified:
   trunk/debian/changelog
   trunk/scripts/bts.pl
Log:
* bts:
  + Correctly handle only one argument being passed to "block" or
    "unblock".

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-11-13 20:14:51 UTC (rev 1725)
+++ trunk/debian/changelog      2008-11-16 19:43:18 UTC (rev 1726)
@@ -12,9 +12,12 @@
     + Update author email address
 
   [ Adam D. Barratt ]
-  * bts: Don't attempt to iterate the list of bugs returned by "bts status"
-    if it's empty, thereby avoiding a "Can't use string ("") as a HASH ref"
-    error.
+  * bts:
+    + Don't attempt to iterate the list of bugs returned by "bts status"
+      if it's empty, thereby avoiding a "Can't use string ("") as a HASH
+      ref" error.
+    + Correctly handle only one argument being passed to "block" or
+      "unblock".
   * checkbashisms:
     + Add an updated check for $'' which is much less prone to false
       positives. Thanks Filippo Giunchedi. (Closes: #504292)

Modified: trunk/scripts/bts.pl
===================================================================
--- trunk/scripts/bts.pl        2008-11-13 20:14:51 UTC (rev 1725)
+++ trunk/scripts/bts.pl        2008-11-16 19:43:18 UTC (rev 1726)
@@ -1296,10 +1296,11 @@
 
 sub bts_block {
     my $bug=checkbug(shift) or die "bts block: what bug is blocked?\n";
-    my $word=shift;
+    my $word=shift || '';
     if ($word ne 'by' && $word ne 'with') {
-           unshift @_, $word;
+           unshift @_, $word if length $word;
     }
+    @_ or die "bts block: need to specify at least two bug numbers\n";
     my @blockers;
     foreach (@_) {
        my $blocker=checkbug($_) or die "bts block: some blocking bug number(s) 
not valid\n";
@@ -1316,10 +1317,11 @@
 
 sub bts_unblock {
     my $bug=checkbug(shift) or die "bts unblock: what bug is blocked?\n";
-    my $word=shift;
+    my $word=shift || '';
     if ($word ne 'by' && $word ne 'with') {
-           unshift @_, $word;
+           unshift @_, $word if length $word;
     }
+    @_ or die "bts unblock: need to specify at least two bug numbers\n";
     my @blockers;
     foreach (@_) {
        my $blocker=checkbug($_) or die "bts unblock: some blocking bug 
number(s) not valid\n";



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

Reply via email to