From ec874b5fe283e481b24fa4289769a936fcc214b3 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 14 Aug 2012 18:08:42 +0000 Subject: [PATCH] Allow gkcommit.pl to accept lists of r numbers and trac ticket numbers This commit was SVN r27033. --- contrib/dist/gkcommit.pl | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/contrib/dist/gkcommit.pl b/contrib/dist/gkcommit.pl index 75091f62dc..93cb7636d2 100755 --- a/contrib/dist/gkcommit.pl +++ b/contrib/dist/gkcommit.pl @@ -94,15 +94,17 @@ if (!@cmrs) { } print "CMR number (-1 to exit)? "; - my $cmr = ; - chomp($cmr); + my $cmrs = ; + chomp($cmrs); last - if (-1 == $cmr); - - if ($cmr > 0) { - push(@cmrs, $cmr); - } else { - print "Invalid CMR number; must be greater than 0 (ignored).\n"; + if (-1 == $cmrs); + + foreach my $cmr (split(/[\s,]+/, $cmrs)) { + if ($cmr > 0) { + push(@cmrs, $cmr); + } else { + print "Invalid CMR number ($cmr); must be greater than 0 (ignored).\n"; + } } } print("\n"); @@ -124,15 +126,18 @@ if (!@rs) { } print "SVN r number (-1 to exit)? "; - my $r = ; - chomp($r); + my $rs = ; + chomp($rs); last - if (-1 == $r); - - if ($r > 0) { - push(@rs, $r); - } else { - print "Invalid SVN r number; must be greater than 0 (ignored).\n"; + if (-1 == $rs); + + foreach my $r (split(/[\s,]+/, $rs)) { + $r =~ s/^r//; + if ($r > 0) { + push(@rs, $r); + } else { + print "Invalid SVN r number ($r); must be greater than 0 (ignored).\n"; + } } } print("\n");