subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1669868 - in /subversion/trunk/tools/dist: backport.pl backport/status.py
Date Sun, 29 Mar 2015 07:25:08 GMT
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



Mime
View raw message