Changeset 45939 in webkit


Ignore:
Timestamp:
Jul 15, 2009 1:11:01 PM (15 years ago)
Author:
bfulgham@webkit.org
Message:

2009-07-15 Joseph Pecoraro <joepeck02@gmail.com>

Reviewed by David Kilzer.

bugzilla-tool/svn-apply can't handle patches made from a non-root directory
https://bugs.webkit.org/show_bug.cgi?id=26999

  • Scripts/svn-create-patch:
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r45920 r45939  
     12009-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
    1102009-07-15  Shinichiro Hamaji  <hamaji@chromium.org>
    211
  • trunk/WebKitTools/Scripts/svn-create-patch

    r44377 r45939  
    4545
    4646use Config;
    47 use Cwd;
    4847use File::Basename;
    4948use File::Spec;
     
    5655sub binarycmp($$);
    5756sub canonicalizePath($);
     57sub chdirAndGetDifference($);
     58sub determineSvnRoot();
    5859sub findBaseUrl($);
    5960sub findMimeType($;$);
     
    6162sub findSourceFileAndRevision($);
    6263sub fixChangeLogPatch($);
    63 sub generateDiff($);
     64sub generateDiff($$);
    6465sub generateFileList($\%);
    6566sub isBinaryMimeType($);
     
    9596}
    9697
     98my $svnRoot = determineSvnRoot();
     99my $prefix = chdirAndGetDifference($svnRoot);
     100
    97101# Generate the diffs, in a order chosen for easy reviewing.
    98102for my $path (sort patchpathcmp values %diffFiles) {
    99     generateDiff($path);
     103    generateDiff($path, $prefix);
    100104}
    101105
     
    253257}
    254258
    255 sub generateDiff($)
    256 {
    257     my ($fileData) = @_;
    258     my $file = $fileData->{path};
     259sub generateDiff($$)
     260{
     261    my ($fileData, $prefix) = @_;
     262    my $file = File::Spec->catdir($prefix, $fileData->{path});
    259263    my $patch;
    260264    if ($fileData->{modificationType} eq "additionWithHistory") {
     
    448452    return $fileDataA->{isTestFile} <=> $fileDataB->{isTestFile};
    449453}
     454
     455sub 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
     464sub 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.