[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Wed Apr 7 23:06:09 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit c5b54bb9f81eee446f5a0c8d7736a7d0b77e61ca
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 26 18:33:50 2009 +0000

    2009-10-23  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Adam Roben.
    
            PrettyPatch should show images even when they have the wrong mime type
            https://bugs.webkit.org/show_bug.cgi?id=29506
    
            * PrettyPatch/PrettyPatch.rb:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50077 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/BugsSite/ChangeLog b/BugsSite/ChangeLog
index 8d79a3f..790915f 100644
--- a/BugsSite/ChangeLog
+++ b/BugsSite/ChangeLog
@@ -1,3 +1,12 @@
+2009-10-23  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Roben.
+
+        PrettyPatch should show images even when they have the wrong mime type
+        https://bugs.webkit.org/show_bug.cgi?id=29506
+
+        * PrettyPatch/PrettyPatch.rb:
+
 2009-10-17  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Eric Carlson.
diff --git a/BugsSite/PrettyPatch/PrettyPatch.rb b/BugsSite/PrettyPatch/PrettyPatch.rb
index 7385f65..7539b74 100644
--- a/BugsSite/PrettyPatch/PrettyPatch.rb
+++ b/BugsSite/PrettyPatch/PrettyPatch.rb
@@ -42,6 +42,8 @@ private
 
     IMAGE_FILE_MARKER_FORMAT = /^svn:mime-type = image\/png$/
 
+    START_OF_BINARY_DATA_FORMAT = /^[0-9a-zA-Z\+\/=]{20,}/ # Assume 20 chars without a space is base64 binary data.
+
     START_OF_SECTION_FORMAT = /^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@\s*(.*)/
 
     START_OF_EXTENT_STRING = "%c" % 0
@@ -182,6 +184,10 @@ EOF
         end
     end
 
+    def self.has_image_suffix(filename)
+        filename =~ /\.(png|jpg|gif)$/
+    end
+
     class FileDiff
         def initialize(lines)
             @filename = PrettyPatch.filename_from_diff_header(lines[0].chomp)
@@ -197,9 +203,16 @@ EOF
                     break
                 when BINARY_FILE_MARKER_FORMAT
                     @binary = true
-                    if (IMAGE_FILE_MARKER_FORMAT.match(lines[i + 1])) then
+                    if (IMAGE_FILE_MARKER_FORMAT.match(lines[i + 1]) or PrettyPatch.has_image_suffix(@filename)) then
                         @image = true
                         startOfSections = i + 2
+                        for x in startOfSections...lines.length
+                            # Binary diffs often have property changes listed before the actual binary data.  Skip them.
+                            if START_OF_BINARY_DATA_FORMAT.match(lines[x]) then
+                                startOfSections = x
+                                break
+                            end
+                        end
                     end
                     break
                 end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list