Commit eee812d5 authored by ddkilzer's avatar ddkilzer
Browse files

2007-05-20 David Kilzer <ddkilzer@webkit.org>

        Reviewed by Adam Roben.

        - fix http://bugs.webkit.org/show_bug.cgi?id=13565
          Change svn-create-patch to put LayoutTests in the end

        In addition to reordering test files under the LayoutTests directory so that they
        appear after source code files, this patch fixes an issue with prepare-ChangeLog
        if the first argument passed to it is a file name instead of a directory name.

        * Scripts/prepare-ChangeLog:
        (isGIT()): If first value in @dirs array is a file, use dirname() to get the directory.
        (isSVN()): Ditto.
        * Scripts/svn-create-patch:
        (generateFileList($\%\%\%)): Differentiate test files in the LayoutTests directory from
        source code files.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3071affa
2007-05-20 David Kilzer <ddkilzer@webkit.org>
Reviewed by Adam Roben.
- fix http://bugs.webkit.org/show_bug.cgi?id=13565
Change svn-create-patch to put LayoutTests in the end
In addition to reordering test files under the LayoutTests directory so that they
appear after source code files, this patch fixes an issue with prepare-ChangeLog
if the first argument passed to it is a file name instead of a directory name.
* Scripts/prepare-ChangeLog:
(isGIT()): If first value in @dirs array is a file, use dirname() to get the directory.
(isSVN()): Ditto.
* Scripts/svn-create-patch:
(generateFileList($\%\%\%)): Differentiate test files in the LayoutTests directory from
source code files.
2007-05-18 Mark Rowe <mrowe@apple.com>
Reviewed by Oliver.
......
......@@ -1073,7 +1073,9 @@ sub isGit()
my $dir = ".";
my @dirs = keys(%paths);
$dir = $dirs[0] if @dirs;
$dir = -d $dirs[0] ? $dirs[0] : dirname($dirs[0]) if @dirs;
$isGit = system("cd $dir && git rev-parse > /dev/null 2>&1") == 0;
return $isGit;
}
......@@ -1085,7 +1087,11 @@ sub isSVN()
my $dir = ".svn";
my @dirs = keys(%paths);
$dir = File::Spec->catdir(($dirs[0], ".svn")) if @dirs;
if (@dirs) {
my $path = -d $dirs[0] ? $dirs[0] : dirname($dirs[0]);
$dir = File::Spec->catdir($path, ".svn");
}
$isSVN = -d $dir;
return $isSVN;
......
......@@ -59,7 +59,7 @@ sub findModificationType($);
sub findSourceFileAndRevision($);
sub fixChangeLogPatch($);
sub generateDiff($$$);
sub generateFileList($\%\%);
sub generateFileList($\%\%\%);
sub isBinaryMimeType($);
sub manufacturePatchForAdditionWithHistory($$);
sub numericcmp($$);
......@@ -79,15 +79,19 @@ if (!GetOptions("help" => \$showHelp) || $showHelp) {
my %paths = processPaths(@ARGV);
# Generate a list of files requiring diffs
my %textFiles;
my %sourceFiles;
my %testFiles;
my %binaryFiles;
for my $path (keys %paths) {
generateFileList($path, %textFiles, %binaryFiles);
generateFileList($path, %sourceFiles, %testFiles, %binaryFiles);
}
# Generate the diff for text files, then binary files, for easy reviewing
for my $file (sort pathcmp keys %textFiles) {
generateDiff($file, $textFiles{$file}, 0);
# Generate the diff for source code files, test files then binary files for easy reviewing
for my $file (sort pathcmp keys %sourceFiles) {
generateDiff($file, $sourceFiles{$file}, 0);
}
for my $file (sort pathcmp keys %testFiles) {
generateDiff($file, $testFiles{$file}, 0);
}
for my $file (sort pathcmp keys %binaryFiles) {
generateDiff($file, $binaryFiles{$file}, 1);
......@@ -236,9 +240,9 @@ sub generateDiff($$$)
}
}
sub generateFileList($\%\%)
sub generateFileList($\%\%\%)
{
my ($statPath, $textFiles, $binaryFiles) = @_;
my ($statPath, $sourceFiles, $testFiles, $binaryFiles) = @_;
open STAT, "svn stat '$statPath' |" or die;
while (my $line = <STAT>) {
chomp $line;
......@@ -249,8 +253,10 @@ sub generateFileList($\%\%)
if ($modificationType) {
if (isBinaryMimeType($path)) {
$binaryFiles->{$path} = $modificationType;
} elsif ((File::Spec->splitdir($path))[0] eq "LayoutTests") {
$testFiles->{$path} = $modificationType;
} else {
$textFiles->{$path} = $modificationType;
$sourceFiles->{$path} = $modificationType;
}
} else {
print STDERR $line, "\n";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment