Changeset 58478 in webkit


Ignore:
Timestamp:
Apr 28, 2010 11:19:24 PM (14 years ago)
Author:
Chris Jerdonek
Message:

2010-04-28 Chris Jerdonek <Chris Jerdonek>

Reviewed by Eric Seidel.

Added to VCSUtils's parseDiffHeader() support for binary patches.

https://bugs.webkit.org/show_bug.cgi?id=38094

The parseDiffHeader() function is part of new patch-parsing code
for svn-apply and svn-unapply that will go live in a subsequent
revision.

  • Scripts/VCSUtils.pm:
    • Added logic to parseDiffHeader() to recognize the ending of the header portion of a binary diff.
  • Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
    • Added unit test cases for SVN and Git binary diffs.
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r58473 r58478  
     12010-04-28  Chris Jerdonek  <cjerdonek@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Added to VCSUtils's parseDiffHeader() support for binary patches.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=38094
     8
     9        The parseDiffHeader() function is part of new patch-parsing code
     10        for svn-apply and svn-unapply that will go live in a subsequent
     11        revision.
     12
     13        * Scripts/VCSUtils.pm:
     14          - Added logic to parseDiffHeader() to recognize the ending of
     15            the header portion of a binary diff.
     16
     17        * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
     18          - Added unit test cases for SVN and Git binary diffs.
     19
    1202010-04-28  Eric Seidel  <eric@webkit.org>
    221
  • trunk/WebKitTools/Scripts/VCSUtils.pm

    r58464 r58478  
    457457                }
    458458            }
    459         } elsif (s/^\+\+\+ \S+/+++ $indexPath/) {
     459        } elsif (s/^\+\+\+ \S+/+++ $indexPath/ ||
     460                 /^Cannot display: file marked as a binary type.$/ || # SVN binary
     461                 /^GIT binary patch$/) {
    460462            # +++
    461463            $foundHeaderEnding = 1;
  • trunk/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl

    r58464 r58478  
    222222    nextLine => "+<html>\n",
    223223},
     224{
     225    # New test
     226    diffName => "SVN: binary file",
     227    inputText => <<'END',
     228Index: test_file.swf
     229===================================================================
     230Cannot display: file marked as a binary type.
     231svn:mime-type = application/octet-stream
     232
     233Property changes on: test_file.swf
     234___________________________________________________________________
     235Name: svn:mime-type
     236   + application/octet-stream
     237
     238
     239Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
     240END
     241    # Header keys to check
     242    svnConvertedText => <<'END',
     243Index: test_file.swf
     244===================================================================
     245Cannot display: file marked as a binary type.
     246END
     247    copiedFromPath => undef,
     248    indexPath => "test_file.swf",
     249    sourceRevision => undef,
     250    # Other values to check
     251    lastReadLine => "svn:mime-type = application/octet-stream\n",
     252    nextLine => "\n",
     253},
     254{
     255    # New test
     256    diffName => "Git: binary addition",
     257    inputText => <<'END',
     258diff --git a/foo.gif b/foo.gif
     259new file mode 100644
     260index 0000000000000000000000000000000000000000..64a9532e7794fcd791f6f12157406d9060151690
     261GIT binary patch
     262literal 512
     263zcmZ?wbhEHbRAx|MU|?iW{Kxc~?KofD;ckY;H+&5HnHl!!GQMD7h+sU{_)e9f^V3c?
     264zhJP##HdZC#4K}7F68@!1jfWQg2daCm-gs#3|JREDT>c+pG4L<_2;w##WMO#ysPPap
     265zLqpAf1OE938xAsSp4!5f-o><?VKe(#0jEcwfHGF4%M1^kRs14oVBp2ZEL{E1N<-zJ
     266zsfLmOtKta;2_;2c#^S1-8cf<nb!QnGl>c!Xe6RXvrEtAWBvSDTgTO1j3vA31Puw!A
     267zs(87q)j_mVDTqBo-P+03-P5mHCEnJ+x}YdCuS7#bCCyePUe(ynK+|4b-3qK)T?Z&)
     268zYG+`tl4h?GZv_$t82}X4*DTE|$;{DEiPyF@)U-1+FaX++T9H{&%cag`W1|zVP@`%b
     269zqiSkp6{BTpWTkCr!=<C6Q=?#~R8^JfrliAF6Q^gV9Iup8RqCXqqhqC`qsyhk<-nlB
     270z00f{QZvfK&|Nm#oZ0TQl`Yr$BIa6A@16O26ud7H<QM=xl`toLKnz-3h@9c9q&wm|X
     271z{89I|WPyD!*M?gv?q`;L=2YFeXrJQNti4?}s!zFo=5CzeBxC69xA<zrjP<wUcCRh4
     272ptUl-ZG<%a~#LwkIWv&q!KSCH7tQ8cJDiw+|GV?MN)RjY50RTb-xvT&H
     273
     274literal 0
     275HcmV?d00001
     276
     277END
     278    # Header keys to check
     279    svnConvertedText => <<'END',
     280Index: foo.gif
     281new file mode 100644
     282index 0000000000000000000000000000000000000000..64a9532e7794fcd791f6f12157406d9060151690
     283GIT binary patch
     284END
     285    copiedFromPath => undef,
     286    indexPath => "foo.gif",
     287    sourceRevision => undef,
     288    # Other values to check
     289    lastReadLine => "literal 512\n",
     290    nextLine => "zcmZ?wbhEHbRAx|MU|?iW{Kxc~?KofD;ckY;H+&5HnHl!!GQMD7h+sU{_)e9f^V3c?\n",
     291},
     292{
     293    # New test
     294    diffName => "Git: binary deletion",
     295    inputText => <<'END',
     296diff --git a/foo.gif b/foo.gif
     297deleted file mode 100644
     298index 323fae0..0000000
     299GIT binary patch
     300literal 0
     301HcmV?d00001
     302
     303literal 7
     304OcmYex&reD$;sO8*F9L)B
     305
     306END
     307    # Header keys to check
     308    svnConvertedText => <<'END',
     309Index: foo.gif
     310deleted file mode 100644
     311index 323fae0..0000000
     312GIT binary patch
     313END
     314    copiedFromPath => undef,
     315    indexPath => "foo.gif",
     316    sourceRevision => undef,
     317    # Other values to check
     318    lastReadLine => "literal 0\n",
     319    nextLine => "HcmV?d00001\n",
     320},
    224321);
    225322
Note: See TracChangeset for help on using the changeset viewer.