Changeset 94554 in webkit
- Timestamp:
- Sep 6, 2011 12:26:13 AM (13 years ago)
- Location:
- trunk/Websites/bugs.webkit.org
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/bugs.webkit.org/ChangeLog
r90132 r94554 1 2011-09-06 Ben Wells <benwells@chromium.org> 2 3 PrettyPatch should handle "delta" patch mechanism in git binary patches 4 https://bugs.webkit.org/show_bug.cgi?id=67628 5 6 Git patches are encoded using two mechanisms - "literal" and "delta". 7 See this email from the git mailing list archive for info 8 http://marc.info/?l=git&m=114682417113315&w=2 9 10 When determining if a binary file patch is an image or not we should accept 11 both literal and delta patch encodings. 12 13 Reviewed by Shinichiro Hamaji. 14 15 * PrettyPatch/PrettyPatch.rb: 16 * PrettyPatch/PrettyPatch_test.rb: 17 1 18 2011-06-30 Adam Barth <abarth@webkit.org> 2 19 -
trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb
r90132 r94554 14 14 def self.prettify(string) 15 15 $last_prettify_file_count = -1 16 $last_prettify_part_count = { "remove" => 0, "add" => 0, "shared" => 0 }16 $last_prettify_part_count = { "remove" => 0, "add" => 0, "shared" => 0, "binary" => 0 } 17 17 string = normalize_line_ending(string) 18 18 fileDiffs = FileDiff.parse(string) … … 66 66 GIT_BINARY_FILE_MARKER_FORMAT = /^GIT binary patch$/ 67 67 68 GIT_ LITERAL_FORMAT = /^literal\d+$/68 GIT_BINARY_PATCH_FORMAT = /^(literal|delta) \d+$/ 69 69 70 70 START_OF_BINARY_DATA_FORMAT = /^[0-9a-zA-Z\+\/=]{20,}/ # Assume 20 chars without a space is base64 binary data. … … 509 509 when GIT_BINARY_FILE_MARKER_FORMAT 510 510 @binary = true 511 if (GIT_ LITERAL_FORMAT.match(lines[i + 1]) and PrettyPatch.has_image_suffix(@filename)) then511 if (GIT_BINARY_PATCH_FORMAT.match(lines[i + 1]) and PrettyPatch.has_image_suffix(@filename)) then 512 512 @git_image = true 513 513 startOfSections = i + 1 … … 586 586 end 587 587 elsif @binary then 588 $last_prettify_part_count["binary"] += 1 588 589 str += "<span class='text'>Binary file, nothing to see here</span>" 589 590 else -
trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch_test.rb
r85657 r94554 27 27 83127 => ["Only add stuff", 2, 2, 0, 3], 28 28 85071 => ["Adds and removes from a file plus git signature", 2, 5, 3, 9], 29 104633 => ["Delta mechanism for binary patch in git diff", 12, 3, 5, 3], 29 30 } 30 31 … … 58 59 assert_equal(info[Info::REMOVE], $last_prettify_part_count["remove"], "Wrong number of 'remove' parts in " + description) 59 60 assert_equal(info[Info::SHARED], $last_prettify_part_count["shared"], "Wrong number of 'shared' parts in " + description) 61 assert_equal(0, $last_prettify_part_count["binary"], "Wrong number of 'binary' parts in " + description) 60 62 end 61 63
Note: See TracChangeset
for help on using the changeset viewer.