Changeset 65732 in webkit


Ignore:
Timestamp:
Aug 20, 2010 7:45:03 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-08-20 Daniel Bates <dbates@rim.com>

Reviewed by Eric Seidel.

svn-apply doesn't detect empty line with Windows line endings
after property value
https://bugs.webkit.org/show_bug.cgi?id=43981

Fixes an issue where an empty line following the property value
in an SVN property change diff would not be detected if it had
Windows line endings (i.e. ended in CRLF). Hence it was consumed
as if it was part of a multi-line property value.

  • Scripts/VCSUtils.pm:
    • Modified parseSvnPropertyValue() to detect empty line with Windows line endings.
    • Added toWindowsLineEndings().
  • Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
    • Added the following test cases: "SVN: binary file (isBinary true) using Windows line endings" "SVN: property diff, followed by file change diff using Windows line endings" "SVN: two consecutive property diffs using Windows line endings" "SVN: binary file with executable bit change usng Windows line endings" "SVN: binary file followed by property change on different file using Windows line endings" "SVN: binary file followed by file change on different file using Windows line endings" "SVN: file change diff with property change, followed by property change diff using Windows line endings" "SVN: file change diff with property change, followed by file change diff using Windows line endings"
  • Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl:
    • Added the following test cases: "add svn:executable, followed by empty line and start of next diff using Windows line endings" "add svn:executable, followed by empty line and start of next property diff using Windows line endings" "multi-line '+' change, followed by empty line and start of next diff using Windows line endings" "multi-line '+' change, followed by empty line and start of next property diff using Windows line endings" "add svn:executable, followed by empty line and start of binary patch using Windows line endings" "multi-line '+' change, followed by empty line and start of binary patch using Windows line endings" "multi-line '-' change, followed by multi-line '+' change, empty line, and start of binary patch using Windows line endings" "single-line '+' with trailing new line using Windows line endings" "single-line '+' with trailing new line, followed by empty line and start of binary patch using Windows line endings" "single-line '-' change with trailing new line, and single-line '+' change using Windows line endings" "multi-line '-' change with trailing new line, and multi-line '+' change using Windows line endings"
  • Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl:
    • Added the following test cases: "single-line '-' change followed by empty line with Windows line endings" "multi-line '+' change and start of binary patch with Windows line endings"
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r65713 r65732  
     12010-08-20  Daniel Bates  <dbates@rim.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        svn-apply doesn't detect empty line with Windows line endings
     6        after property value
     7        https://bugs.webkit.org/show_bug.cgi?id=43981
     8
     9        Fixes an issue where an empty line following the property value
     10        in an SVN property change diff would not be detected if it had
     11        Windows line endings (i.e. ended in CRLF). Hence it was consumed
     12        as if it was part of a multi-line property value.
     13
     14        * Scripts/VCSUtils.pm:
     15          - Modified parseSvnPropertyValue() to detect empty line
     16            with Windows line endings.
     17          - Added toWindowsLineEndings().
     18        * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
     19          - Added the following test cases:
     20            "SVN: binary file (isBinary true) using Windows line endings"
     21            "SVN: property diff, followed by file change diff using Windows line endings"
     22            "SVN: two consecutive property diffs using Windows line endings"
     23            "SVN: binary file with executable bit change usng Windows line endings"
     24            "SVN: binary file followed by property change on different file using Windows line endings"
     25            "SVN: binary file followed by file change on different file using Windows line endings"
     26            "SVN: file change diff with property change, followed by property change diff using Windows line endings"
     27            "SVN: file change diff with property change, followed by file change diff using Windows line endings"
     28        * Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl:
     29          - Added the following test cases:
     30            "add svn:executable, followed by empty line and start of next diff using Windows line endings"
     31            "add svn:executable, followed by empty line and start of next property diff using Windows line endings"
     32            "multi-line '+' change, followed by empty line and start of next diff using Windows line endings"
     33            "multi-line '+' change, followed by empty line and start of next property diff using Windows line endings"
     34            "add svn:executable, followed by empty line and start of binary patch using Windows line endings"
     35            "multi-line '+' change, followed by empty line and start of binary patch using Windows line endings"
     36            "multi-line '-' change, followed by multi-line '+' change, empty line, and start of binary patch using Windows line endings"
     37            "single-line '+' with trailing new line using Windows line endings"
     38            "single-line '+' with trailing new line, followed by empty line and start of binary patch using Windows line endings"
     39            "single-line '-' change with trailing new line, and single-line '+' change using Windows line endings"
     40            "multi-line '-' change with trailing new line, and multi-line '+' change using Windows line endings"
     41        * Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl:
     42          - Added the following test cases:
     43            "single-line '-' change followed by empty line with Windows line endings"
     44            "multi-line '+' change and start of binary patch with Windows line endings"
     45
    1462010-08-19  David Kilzer  <ddkilzer@apple.com>
    247
  • trunk/WebKitTools/Scripts/VCSUtils.pm

    r63062 r65732  
    7373        &svnRevisionForDirectory
    7474        &svnStatus
     75        &toWindowsLineEndings
    7576    );
    7677    %EXPORT_TAGS = ( );
     
    127128
    128129    return @returnValue;
     130}
     131
     132sub toWindowsLineEndings
     133{
     134    my ($text) = @_;
     135    $text =~ s/\n/\r\n/g;
     136    return $text;
    129137}
    130138
     
    10901098
    10911099    while (<$fileHandle>) {
    1092         if (/^$/ || /$svnPropertyValueStartRegEx/ || /$svnPropertyStartRegEx/) {
     1100        if (/^[\r\n]+$/ || /$svnPropertyValueStartRegEx/ || /$svnPropertyStartRegEx/) {
    10931101            # Note, we may encounter an empty line before the contents of a binary patch.
    10941102            # Also, we check for $svnPropertyValueStartRegEx because a '-' property may be
Note: See TracChangeset for help on using the changeset viewer.