Title: [160642] trunk/Websites/bugs.webkit.org
Revision
160642
Author
[email protected]
Date
2013-12-16 08:45:11 -0800 (Mon, 16 Dec 2013)

Log Message

PrettyPatch.rb doesn't handle diffs where lines matching /^--/ are missing properly
https://bugs.webkit.org/show_bug.cgi?id=54928

Patch by Dániel Bátyai <[email protected]> on 2013-12-16
Reviewed by Adam Roben.

PrettyPatch will now check if the next line after /^--- / matches /^+++ /, and if not,
then it's just a normal line

* PrettyPatch/PrettyPatch.rb:

Modified Paths

Diff

Modified: trunk/Websites/bugs.webkit.org/ChangeLog (160641 => 160642)


--- trunk/Websites/bugs.webkit.org/ChangeLog	2013-12-16 16:18:30 UTC (rev 160641)
+++ trunk/Websites/bugs.webkit.org/ChangeLog	2013-12-16 16:45:11 UTC (rev 160642)
@@ -1,3 +1,15 @@
+2013-12-16  Dániel Bátyai  <[email protected]>
+
+        PrettyPatch.rb doesn't handle diffs where lines matching /^--/ are missing properly
+        https://bugs.webkit.org/show_bug.cgi?id=54928
+
+        Reviewed by Adam Roben.
+
+        PrettyPatch will now check if the next line after /^--- / matches /^+++ /, and if not,
+        then it's just a normal line
+
+        * PrettyPatch/PrettyPatch.rb:
+
 2013-08-16  David Farler  <[email protected]>
 
         PrettyPatch: Wrap pre blocks

Modified: trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb (160641 => 160642)


--- trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb	2013-12-16 16:18:30 UTC (rev 160641)
+++ trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb	2013-12-16 16:45:11 UTC (rev 160642)
@@ -662,11 +662,12 @@
         def self.parse(string)
             haveSeenDiffHeader = false
             linesForDiffs = []
-            string.each_line do |line|
+            line_array = string.lines.to_a
+            line_array.each_with_index do |line, index|
                 if (PrettyPatch.diff_header?(line))
                     linesForDiffs << []
                     haveSeenDiffHeader = true
-                elsif (!haveSeenDiffHeader && line =~ /^--- /)
+                elsif (!haveSeenDiffHeader && line =~ /^--- / && line_array[index + 1] =~ /^\+\+\+ /)
                     linesForDiffs << []
                     haveSeenDiffHeader = false
                 end
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to