Changeset 46095 in webkit


Ignore:
Timestamp:
Jul 18, 2009 11:50:02 AM (15 years ago)
Author:
pkasting@chromium.org
Message:

2009-07-17 Peter Kasting <pkasting@google.com>

Reviewed by David Kilzer.

https://bugs.webkit.org/show_bug.cgi?id=27323
Further improve non-Cygwin SVN support.

  • Scripts/prepare-ChangeLog: Harmless change to be consistent with other places that consume whitespace at the end of svn output.
  • Scripts/resolve-ChangeLogs: Add support for SVN 1.6. Slightly optimize svn info parsing based on technique in svn-create-patch. Normalize paths and consume whitespace in the same way as prepare-ChangeLog, for Windows systems with a non-Cygwin SVN. Force diff and patch to run in binary mode so that they won't "intelligently" screw up line endings.
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r46093 r46095  
     12009-07-17  Peter Kasting  <pkasting@google.com>
     2
     3        Reviewed by David Kilzer.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=27323
     6        Further improve non-Cygwin SVN support.
     7
     8        * Scripts/prepare-ChangeLog: Harmless change to be consistent with other
     9          places that consume whitespace at the end of svn output.
     10        * Scripts/resolve-ChangeLogs: Add support for SVN 1.6.  Slightly
     11          optimize svn info parsing based on technique in svn-create-patch.
     12          Normalize paths and consume whitespace in the same way as
     13          prepare-ChangeLog, for Windows systems with a non-Cygwin SVN.  Force
     14          diff and patch to run in binary mode so that they won't
     15          "intelligently" screw up line endings.
     16
    1172009-07-18  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/WebKitTools/Scripts/prepare-ChangeLog

    r46064 r46095  
    12811281sub diffHeaderFormat()
    12821282{
    1283     return qr/^Index: (\S+)\r?\n?$/ if $isSVN;
     1283    return qr/^Index: (\S+)\s*$/ if $isSVN;
    12841284    return qr/^diff --git a\/.+ b\/(.+)$/ if $isGit;
    12851285}
     
    12911291    open INFO, "$SVN info . |" or die;
    12921292    while (<INFO>) {
    1293         if (/^URL: (.*\S+)\r?\n?$/) {
     1293        if (/^URL: (.*\S+)\s*$/) {
    12941294            $baseUrl = $1;
    12951295        }
     
    12991299    open INFO, "$SVN info '$file' |" or die;
    13001300    while (<INFO>) {
    1301         if (/^Copied From URL: (.*\S+)\r?\n?$/) {
     1301        if (/^Copied From URL: (.*\S+)\s*$/) {
    13021302            $sourceFile = File::Spec->abs2rel($1, $baseUrl);
    13031303        }
     
    13201320            my $matches;
    13211321            if (eval "v$svnVersion" ge v1.6) {
    1322                 $matches = /^([ACDMR]).{6} (.*\S+)\r?\n?$/;
     1322                $matches = /^([ACDMR]).{6} (.*\S+)\s*$/;
    13231323                $status = $1;
    13241324                $file = $2;
    13251325            } else {
    1326                 $matches = /^([ACDMR]).{5} (.*\S+)\r?\n?$/;
     1326                $matches = /^([ACDMR]).{5} (.*\S+)\s*$/;
    13271327                $status = $1;
    13281328                $file = $2;
  • trunk/WebKitTools/Scripts/resolve-ChangeLogs

    r44092 r46095  
    5555sub showStatus($;$);
    5656sub usageAndExit();
     57sub normalizePath($);
    5758
    5859my $isGit = isGit();
     
    6162my $SVN = "svn";
    6263my $GIT = "git";
     64
     65my $svnVersion = `svn --version --quiet` if $isSVN;
    6366
    6467my $fixMerged;
     
    165168        open INFO, "-|", $SVN, "info", $file || die;
    166169        while (my $line = <INFO>) {
    167             $currentRevision = $1 if $line =~ m/^Revision: ([0-9]+)/;
     170            if ($line =~ m/^Revision: ([0-9]+)/) {
     171                $currentRevision = $1;
     172                { local $/ = undef; <INFO>; }  # Consume rest of input.
     173            }
    168174        }
    169175        close INFO;
     
    237243    while (<STAT>) {
    238244        if ($isSVN) {
    239             if (/^([C]).{5} (.+)$/) {
    240                 my $file = findChangeLog($2);
     245            my $matches;
     246            my $file;
     247            if (eval "v$svnVersion" ge v1.6) {
     248                $matches = /^([C]).{6} (.*\S+)\s*$/;
     249                $file = $2;
     250            } else {
     251                $matches = /^([C]).{5} (.*\S+)\s*$/;
     252                $file = $2;
     253            }
     254            if ($matches) {
     255                $file = findChangeLog(normalizePath($file));
    241256                push @results, $file if $file;
    242257            } else {
     
    245260        } elsif ($isGit) {
    246261            if (/^([U])\t(.+)$/) {
    247                 my $file = findChangeLog($2);
     262                my $file = findChangeLog(normalizePath($2));
    248263                push @results, $file if $file;
    249264            } else {
     
    420435        rename($fileOlder, "$fileOlder.save");
    421436    } else {
    422         open(DIFF, "-|", qw(diff -u), $fileOlder, $fileMine) || die;
     437        open(DIFF, "-|", qw(diff -u -a --binary), $fileOlder, $fileMine) || die;
    423438        $patch = <DIFF>;
    424439        close(DIFF);
     
    428443    unlink("${fileNewer}.rej");
    429444
    430     open(PATCH, "| patch --fuzz=3 $fileNewer > /dev/null") || die;
     445    open(PATCH, "| patch --fuzz=3 --binary $fileNewer > /dev/null") || die;
    431446    print PATCH fixChangeLogPatch($patch);
    432447    close(PATCH);
     
    535550    }
    536551}
     552
     553sub normalizePath($)
     554{
     555    my ($path) = @_;
     556    $path =~ s/\\/\//g;
     557    return $path;
     558}
Note: See TracChangeset for help on using the changeset viewer.