Author: adam-guest
Date: 2008-09-04 20:58:25 +0000 (Thu, 04 Sep 2008)
New Revision: 1613

Modified:
   trunk/debian/changelog
   trunk/scripts/bts.pl
Log:
Ensure that the "clone" command is always passed at least one new bug ID
(Closes: #497826) and that the new IDs are negative numbers.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-08-30 18:16:08 UTC (rev 1612)
+++ trunk/debian/changelog      2008-09-04 20:58:25 UTC (rev 1613)
@@ -15,6 +15,8 @@
       In the process (hopefully) make a number of the mangles more resilient
       to BTS HTML changes.
     + Mention in the manpage that BTS_ONLY_NEW corresponds to --only-new.
+    + Ensure that the "clone" command is always passed at least one new bug ID
+      (Closes: #497826) and that the new IDs are negative numbers.
   * checkbashisms: Flag "read without variable" and "read with options other
     than -r" separately to ensure that all uses are correctly matched. Thanks
     to Frank Lichtenheld for pointing this out via a related bug in lintian.

Modified: trunk/scripts/bts.pl
===================================================================
--- trunk/scripts/bts.pl        2008-08-30 18:16:08 UTC (rev 1612)
+++ trunk/scripts/bts.pl        2008-09-04 20:58:25 UTC (rev 1613)
@@ -1022,7 +1022,7 @@
     }
 }
 
-=item clone <bug> [new IDs]
+=item clone <bug> <new ID> [<new ID> ...]
 
 The clone control command allows you to duplicate a bug report. It is useful
 in the case where a single report actually indicates that multiple distinct
@@ -1034,7 +1034,11 @@
 
 sub bts_clone {
     my $bug=checkbug(shift) or die "bts clone: clone what bug?\n";
-    @[EMAIL PROTECTED] = (1) x @_;  # add these bug numbers to hash
+    @_ or die "bts clone: must specify at least one new ID\n";
+    foreach (@_) {
+       $_ =~ /^-\d+$/ or die "bts clone: new IDs must be negative numbers\n";
+       $clonedbugs{$_} = 1;
+    }
     mailbts("cloning $bug", "clone $bug " . join(" ",@_));
 }
 



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

Reply via email to