Author: danielsh
Date: Mon Feb 12 16:36:08 2018
New Revision: 1824013

URL: http://svn.apache.org/viewvc?rev=1824013&view=rev
Log:
backport.py: Fix a bug in parsing logsummaries that start with a word followed
by a colon, which looks like a header.  See r1824001 for an example.

backport.pl already DTRTs in that case (it passes the new test).

* tools/dist/backport/status.py
  (StatusEntry._parse): Consider the first line a logsummary regardless of
    what it looks like.

* tools/dist/backport_tests.py
  (backport_logsummary_colon): New test.

* tools/dist/backport_tests_data/backport_logsummary_colon.dump:
    New expected test output.

Added:
    
subversion/trunk/tools/dist/backport_tests_data/backport_logsummary_colon.dump
      - copied, changed from r1823975, 
subversion/trunk/tools/dist/backport_tests_data/backport_unicode_entry.dump
Modified:
    subversion/trunk/tools/dist/backport/status.py
    subversion/trunk/tools/dist/backport_tests.py

Modified: subversion/trunk/tools/dist/backport/status.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/dist/backport/status.py?rev=1824013&r1=1824012&r2=1824013&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport/status.py (original)
+++ subversion/trunk/tools/dist/backport/status.py Mon Feb 12 16:36:08 2018
@@ -379,9 +379,11 @@ class StatusEntry:
       raise ParseException("Entry found with neither branch nor revisions")
 
     # Parse the logsummary.
-    while lines and not self._is_subheader(lines[0]):
+    while True:
       self.logsummary.append(lines[0])
       lines = lines[1:]
+      if (not lines) or self._is_subheader(lines[0]):
+        break
 
     # Parse votes.
     if "Votes:" in lines:

Modified: subversion/trunk/tools/dist/backport_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/dist/backport_tests.py?rev=1824013&r1=1824012&r2=1824013&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport_tests.py (original)
+++ subversion/trunk/tools/dist/backport_tests.py Mon Feb 12 16:36:08 2018
@@ -660,6 +660,21 @@ def backport_unicode_entry(sbox):
   # Run it.
   run_backport(sbox)
 
+#----------------------------------------------------------------------
+@BackportTest('76cee987-25c9-4d6c-ad40-000000000013')
+def backport_logsummary_colon(sbox):
+  "a logsummary that looks like a header"
+
+  # r6: nominate r4
+  approved_entries = [
+    make_entry([4], logsummary="HTTPv2: Add comments."),
+  ]
+  sbox.simple_append(STATUS, serialize_STATUS(approved_entries))
+  sbox.simple_commit(message='Nominate r4')
+
+  # Run it.
+  run_backport(sbox)
+
 
 #----------------------------------------------------------------------
 
@@ -680,6 +695,7 @@ test_list = [ None,
               backport_otherproject_change,
               backport_STATUS_mods,
               backport_unicode_entry,
+              backport_logsummary_colon,
               # When adding a new test, include the test number in the last
               # 6 bytes of the UUID, in decimal.
              ]

Copied: 
subversion/trunk/tools/dist/backport_tests_data/backport_logsummary_colon.dump 
(from r1823975, 
subversion/trunk/tools/dist/backport_tests_data/backport_unicode_entry.dump)
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/dist/backport_tests_data/backport_logsummary_colon.dump?p2=subversion/trunk/tools/dist/backport_tests_data/backport_logsummary_colon.dump&p1=subversion/trunk/tools/dist/backport_tests_data/backport_unicode_entry.dump&r1=1823975&r2=1824013&rev=1824013&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport_tests_data/backport_unicode_entry.dump 
(original)
+++ 
subversion/trunk/tools/dist/backport_tests_data/backport_logsummary_colon.dump 
Mon Feb 12 16:36:08 2018
@@ -1,6 +1,6 @@
 SVN-fs-dump-format-version: 2
 
-UUID: 76cee987-25c9-4d6c-ad40-000000000012
+UUID: 76cee987-25c9-4d6c-ad40-000000000013
 
 Revision-number: 0
 Prop-content-length: 10
@@ -426,10 +426,10 @@ PROPS-END
 Node-path: branch/STATUS
 Node-kind: file
 Node-action: change
-Text-content-md5: d231ec40c1bf173586fb850acb0df85e
-Text-content-sha1: 22e99a1d851ed1e4b5dfed1f18934b039d7f8c22
-Text-content-length: 263
-Content-length: 263
+Text-content-md5: 21cf72d59d9e71a49260e3cf31f78b76
+Text-content-sha1: 9938559a403d5a18099aace3db6719bdb8940449
+Text-content-length: 245
+Content-length: 245
 
 Status of 1.8.x:
 
@@ -446,16 +446,15 @@ Approved changes:
 =================
 
  * r4
-   default logsummary
-   Notes: Hello 🗺
+   HTTPv2: Add comments.
    Votes:
      +1: jrandom
 
 
 
 Revision-number: 7
-Prop-content-length: 153
-Content-length: 153
+Prop-content-length: 135
+Content-length: 135
 
 K 10
 svn:author
@@ -463,12 +462,11 @@ V 6
 daniel
 K 7
 svn:log
-V 98
+V 80
 Merge r4 from trunk:
 
  * r4
-   default logsummary
-   Notes: Hello 🗺
+   HTTPv2: Add comments.
    Votes:
      +1: jrandom
 


Reply via email to