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 2015/03/29 09:25:08 UTC

svn commit: r1669868 - in /subversion/trunk/tools/dist: backport.pl backport/status.py

Author: danielsh
Date: Sun Mar 29 07:25:08 2015
New Revision: 1669868

URL: http://svn.apache.org/r1669868
Log:
backport STATUS parser: Fix parsing of logsummary in an edge case.

* tools/dist/backport/status.py
  (StatusEntry._is_subheader): Require first letter to be a capital.
  (Test_StatusEntry.test___init__): Regression test this.

* tools/dist/backport.pl
  (parse_entry): Apply the same fix.  No new test.

Modified:
    subversion/trunk/tools/dist/backport.pl
    subversion/trunk/tools/dist/backport/status.py

Modified: subversion/trunk/tools/dist/backport.pl
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/backport.pl?rev=1669868&r1=1669867&r2=1669868&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport.pl (original)
+++ subversion/trunk/tools/dist/backport.pl Sun Mar 29 07:25:08 2015
@@ -578,7 +578,7 @@ sub parse_entry {
   # summary
   do {
     push @logsummary, shift
-  } until $_[0] =~ /^\s*[][\w]+:/ or not defined $_[0];
+  } until $_[0] =~ /^\s*[A-Z][][\w]*:/ or not defined $_[0];
 
   # votes
   unshift @votes, pop until $_[-1] =~ /^\s*Votes:/ or not defined $_[-1];

Modified: subversion/trunk/tools/dist/backport/status.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/backport/status.py?rev=1669868&r1=1669867&r2=1669868&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport/status.py (original)
+++ subversion/trunk/tools/dist/backport/status.py Sun Mar 29 07:25:08 2015
@@ -493,7 +493,7 @@ class StatusEntry:
     #
     # This is currently only used for finding the end of logsummary, and all
     # explicitly special-cased headers (e.g., "Depends:") match this, though.
-    return re.compile(r'^\s*\w+:').match(string)
+    return re.compile(r'^\s*[A-Z]\w*:').match(string)
 
   def unparse(self, stream):
     "Write this entry to STREAM, an open file-like object."
@@ -620,6 +620,19 @@ class Test_StatusEntry(unittest.TestCase
     with self.assertRaisesRegex(ParseException, "Too many.*--accept"):
       entry = StatusEntry(s)
 
+    # logsummary that resembles a subheader
+    s = """\
+      * r42
+        svnversion: Fix typo in output.
+        Justification:
+          Fixes output that scripts depend on.
+        Votes:
+          +1: jrandom
+    """
+    entry = StatusEntry(s)
+    self.assertEqual(entry.revisions, [42])
+    self.assertEqual(entry.logsummary, ["svnversion: Fix typo in output."])
+
   def test_digest(self):
     s = """\
       * r42