Changeset 45939 in webkit
- Timestamp:
- Jul 15, 2009 1:11:01 PM (15 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r45920 r45939 1 2009-07-15 Joseph Pecoraro <joepeck02@gmail.com> 2 3 Reviewed by David Kilzer. 4 5 bugzilla-tool/svn-apply can't handle patches made from a non-root directory 6 https://bugs.webkit.org/show_bug.cgi?id=26999 7 8 * Scripts/svn-create-patch: 9 1 10 2009-07-15 Shinichiro Hamaji <hamaji@chromium.org> 2 11 -
trunk/WebKitTools/Scripts/svn-create-patch
r44377 r45939 45 45 46 46 use Config; 47 use Cwd;48 47 use File::Basename; 49 48 use File::Spec; … … 56 55 sub binarycmp($$); 57 56 sub canonicalizePath($); 57 sub chdirAndGetDifference($); 58 sub determineSvnRoot(); 58 59 sub findBaseUrl($); 59 60 sub findMimeType($;$); … … 61 62 sub findSourceFileAndRevision($); 62 63 sub fixChangeLogPatch($); 63 sub generateDiff($ );64 sub generateDiff($$); 64 65 sub generateFileList($\%); 65 66 sub isBinaryMimeType($); … … 95 96 } 96 97 98 my $svnRoot = determineSvnRoot(); 99 my $prefix = chdirAndGetDifference($svnRoot); 100 97 101 # Generate the diffs, in a order chosen for easy reviewing. 98 102 for my $path (sort patchpathcmp values %diffFiles) { 99 generateDiff($path );103 generateDiff($path, $prefix); 100 104 } 101 105 … … 253 257 } 254 258 255 sub generateDiff($ )256 { 257 my ($fileData ) = @_;258 my $file = $fileData->{path};259 sub generateDiff($$) 260 { 261 my ($fileData, $prefix) = @_; 262 my $file = File::Spec->catdir($prefix, $fileData->{path}); 259 263 my $patch; 260 264 if ($fileData->{modificationType} eq "additionWithHistory") { … … 448 452 return $fileDataA->{isTestFile} <=> $fileDataB->{isTestFile}; 449 453 } 454 455 sub chdirAndGetDifference($) 456 { 457 my ($newdir) = @_; 458 my $before = File::Spec->rel2abs( File::Spec->curdir() ); 459 chdir $newdir; 460 my $after = File::Spec->rel2abs( File::Spec->curdir() ); 461 return File::Spec->abs2rel($before, $after); 462 } 463 464 sub determineSvnRoot() 465 { 466 my $last = ''; 467 my $path = '.'; 468 my $parent = '../'; 469 my $devnull = File::Spec->devnull(); 470 my $exitCode; 471 while (1) { 472 $exitCode = system("svn info $path 2> $devnull > $devnull")/256; 473 last if $exitCode; 474 $last = $path; 475 $path = $parent . $path; 476 } 477 478 return File::Spec->rel2abs($last); 479 }
Note: See TracChangeset
for help on using the changeset viewer.