Changeset 58741 in webkit
- Timestamp:
- May 4, 2010 1:00:54 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r58739 r58741 1 2010-05-04 Chris Jerdonek <cjerdonek@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Adjusted svn-apply and -unapply to accept git diffs generated 6 using the --no-prefix flag. 7 8 https://bugs.webkit.org/show_bug.cgi?id=32438 9 10 * Scripts/VCSUtils.pm: 11 - Loosened the regular expression for the "diff --git" line to 12 match when the --no-prefix flag is used with "git diff". 13 - Also refactored the code parsing the first line so that the 14 script exits with an error message if the first line cannot 15 be parsed. 16 * Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl: 17 - Added a unit test case for the --no-prefix case. 18 1 19 2010-05-04 Chris Jerdonek <cjerdonek@webkit.org> 2 20 -
trunk/WebKitTools/Scripts/VCSUtils.pm
r58739 r58741 440 440 $_ = $line; 441 441 442 my $headerStartRegEx = qr/^diff --git /; 443 444 if (!/$headerStartRegEx/) { 445 die("First line of Git diff does not begin with \"diff --git \": \"$_\""); 442 my $headerStartRegEx = qr#^diff --git (\w/)?(.+) (\w/)?([^\r\n]+)#; 443 my $indexPath; 444 if (/$headerStartRegEx/) { 445 $indexPath = $2; 446 # Use $POSTMATCH to preserve the end-of-line character. 447 $_ = "Index: $indexPath$POSTMATCH"; # Convert to SVN format. 448 } else { 449 die("Could not parse leading \"diff --git\" line: \"$line\"."); 446 450 } 447 451 448 452 my $foundHeaderEnding; 449 my $indexPath;450 453 my $newExecutableBit = 0; 451 454 my $oldExecutableBit = 0; … … 457 460 my $eol = $1; 458 461 459 if (m#^diff --git \w/(.+) \w/([^\r\n]+)#) { 460 $indexPath = $1; 461 $_ = "Index: $indexPath"; # Convert to SVN format. 462 } elsif (/^(deleted file|old) mode ([0-9]{6})/) { 462 if (/^(deleted file|old) mode ([0-9]{6})/) { 463 463 $oldExecutableBit = (isExecutable($2) ? 1 : 0); 464 464 } elsif (/^new( file)? mode ([0-9]{6})/) { -
trunk/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl
r58681 r58741 84 84 expectedNextLine => "+<html>\n", 85 85 }, 86 { # New test 87 diffName => "using --no-prefix", 88 inputText => <<'END', 89 diff --git foo.h foo.h 90 index c925780..9e65c43 100644 91 --- foo.h 92 +++ foo.h 93 @@ -1,3 +1,17 @@ 94 +contents 95 END 96 expectedReturn => [ 97 { 98 svnConvertedText => <<'END', 99 Index: foo.h 100 index c925780..9e65c43 100644 101 --- foo.h 102 +++ foo.h 103 END 104 executableBitDelta => 0, 105 indexPath => "foo.h", 106 }, 107 "@@ -1,3 +1,17 @@\n"], 108 expectedNextLine => "+contents\n", 109 }, 86 110 #### 87 111 # Binary file test cases
Note: See TracChangeset
for help on using the changeset viewer.