You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/02/12 05:41:57 UTC
svn commit: r1567523 - /subversion/trunk/tools/dist/backport.pl
Author: breser
Date: Wed Feb 12 04:41:57 2014
New Revision: 1567523
URL: http://svn.apache.org/r1567523
Log:
backport.pl: Be more flexible about indentation.
The initial indentation before the * will determine how deep
everything else needs to be. So if for instance someone puts
the * in the first column, it'll work as long as the relative
indents are all correct.
* tools/dist/backport.pl
(parse_entry): calculate the relative indentation and strip it.
(backport_main): asterisk can be in any position with or without
leading spaces to start a backport entry.
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=1567523&r1=1567522&r2=1567523&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport.pl (original)
+++ subversion/trunk/tools/dist/backport.pl Wed Feb 12 04:41:57 2014
@@ -348,9 +348,10 @@ sub parse_entry {
my (@revisions, @logsummary, $branch, @votes);
# @lines = @_;
- # strip first three spaces
- $_[0] =~ s/^ \* / /;
- s/^ // for @_;
+ # strip spaces to match up with the indention
+ $_[0] =~ s/^( *)\* //;
+ my $indentation = ' ' x (length($1) + 2);
+ s/^$indentation// for @_;
# revisions
$branch = sanitize_branch $1
@@ -871,9 +872,9 @@ sub backport_main {
break;
}
# Backport entry?
- when (/^ \*/) {
+ when (/^ *\*/) {
warn "Too many bullets in $lines[0]" and next
- if grep /^ \*/, @lines[1..$#lines];
+ if grep /^ *\*/, @lines[1..$#lines];
handle_entry $in_approved, \%approved, \%votes, $state, $lines, $skip,
@lines;
}