You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2014/02/20 02:49:50 UTC
svn commit: r1570043 - /subversion/trunk/tools/dist/backport.pl
Author: danielsh
Date: Thu Feb 20 01:49:49 2014
New Revision: 1570043
URL: http://svn.apache.org/r1570043
Log:
backport.pl: Avoid fragile use of global variable. No functional change.
* tools/dist/backport.pl
(parse_entry): Instead of using $., accept $parno from the caller.
(handle_entry): Percolate it.
(backport_main): Pass $. ($INPUT_LINE_NUMBER) to callee.
Modified:
subversion/trunk/tools/dist/backport.pl
Modified: subversion/trunk/tools/dist/backport.pl
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/backport.pl?rev=1570043&r1=1570042&r2=1570043&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport.pl (original)
+++ subversion/trunk/tools/dist/backport.pl Thu Feb 20 01:49:49 2014
@@ -352,6 +352,7 @@ sub logsummarysummary {
# TODO: may need to parse other headers too?
sub parse_entry {
my $raw = shift;
+ my $parno = shift;
my @lines = @_;
my $depends;
my $accept;
@@ -444,7 +445,7 @@ sub parse_entry {
accept => $accept,
raw => $raw,
digest => digest_entry($raw),
- parno => ($.),
+ parno => $parno, # $. from backport_main()
);
}
@@ -712,8 +713,9 @@ sub handle_entry {
my $votes = shift;
my $state = shift;
my $raw = shift;
+ my $parno = shift;
my $skip = shift;
- my %entry = parse_entry $raw, @_;
+ my %entry = parse_entry $raw, $parno, @_;
my @vetoes = grep { /^ -1:/ } @{$entry{votes}};
my $match = defined($skip) ? ($raw =~ /\Q$skip\E/ or $raw =~ /$skip/msi) : 0
@@ -935,7 +937,8 @@ sub backport_main {
when (/^ *\*/) {
warn "Too many bullets in $lines[0]" and next
if grep /^ *\*/, @lines[1..$#lines];
- handle_entry $in_approved, \%approved, \%votes, $state, $lines, $skip,
+ handle_entry $in_approved, \%approved, \%votes, $state, $lines, $.,
+ $skip,
@lines;
}
default {