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/18 10:26:04 UTC
svn commit: r1569243 - /subversion/trunk/tools/dist/backport.pl
Author: danielsh
Date: Tue Feb 18 09:26:03 2014
New Revision: 1569243
URL: http://svn.apache.org/r1569243
Log:
backport.pl: renormalize: Permit whitespace lines inside entries.
Suggested by: breser
* tools/dist/backport.pl
(renormalize_STATUS): As above.
While here, extend commentary.
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=1569243&r1=1569242&r2=1569243&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport.pl (original)
+++ subversion/trunk/tools/dist/backport.pl Tue Feb 18 09:26:03 2014
@@ -596,13 +596,24 @@ sub check_local_mods_to_STATUS {
sub renormalize_STATUS {
my $vimscript = <<'EOVIM';
-:"" Strip trailing whitespace.
-:%s/\s*$//
+:"" Strip trailing whitespace before entries and section headers, but not
+:"" inside entries (e.g., multi-paragraph Notes: fields).
+:""
+:"" Since an entry is always followed by another entry, section header, or EOF,
+:"" there is no need to separately strip trailing whitespace from lines following
+:"" entries.
+:%s/\v\s+\n(\s*\n)*\ze(\s*[*]|\w)/\r\r/g
+
:"" Ensure there is exactly one blank line around each entry and header.
+:""
+:"" First, inject a new empty line above and below each entry and header; then,
+:"" squeeze runs of empty lines together.
:0/^=/,$ g/^ *[*]/normal! O
:g/^=/normal! o
:g/^=/-normal! O
+:
:%s/\n\n\n\+/\r\r/g
+
:"" Save.
:wq
EOVIM