Commit c93f2159 authored by abarth@webkit.org's avatar abarth@webkit.org

2009-06-16 Adam Barth <abarth@webkit.org>

        Reviewed by Darin Alder.

        https://bugs.webkit.org/show_bug.cgi?id=26000

        Teach prepare-ChangeLog to match the line ends that are already present
        in ChangeLog files.  This helps folks whose use cygwin perl with CR LF
        line endings on Windows.

        Also, teach prepare-ChangeLog to normalize backslashes in paths.  This
        helps folks who use Windows SVN prepare correct ChangeLogs.

        * Scripts/prepare-ChangeLog:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d84bbb99
2009-06-16 Adam Barth <abarth@webkit.org>
Reviewed by Darin Alder.
https://bugs.webkit.org/show_bug.cgi?id=26000
Teach prepare-ChangeLog to match the line ends that are already present
in ChangeLog files. This helps folks whose use cygwin perl with CR LF
line endings on Windows.
Also, teach prepare-ChangeLog to normalize backslashes in paths. This
helps folks who use Windows SVN prepare correct ChangeLogs.
* Scripts/prepare-ChangeLog:
== Rolled over to ChangeLog-2009-06-16 ==
......@@ -86,6 +86,8 @@ sub get_function_line_ranges_for_javascript($$);
sub method_decl_to_selector($);
sub processPaths(\@);
sub reviewerAndDescriptionForGitCommit($);
sub normalizeLineEndings($$);
sub normalizePath($);
# Project time zone for Cupertino, CA, US
my $changeLogTimeZone = "PST8PDT";
......@@ -300,28 +302,34 @@ foreach my $prefix (sort keys %files) {
# to read it while we prepend to it later, but I like doing this part first.
my @old_change_log = <OLD_CHANGE_LOG>;
close OLD_CHANGE_LOG;
# We want to match the ChangeLog's line endings in case it doesn't match
# the native line endings for this version of perl.
my $endl = "\n";
if ($old_change_log[0] =~ /(\r?\n)/g) {
$endl = "$1";
}
open CHANGE_LOG, "> ${changeLogPath}" or die "Could not write ${changeLogPath}\n.";
print CHANGE_LOG "$date $name <$email_address>\n\n";
print CHANGE_LOG normalizeLineEndings("$date $name <$email_address>\n\n", $endl);
my ($reviewer, $description) = reviewerAndDescriptionForGitCommit($gitCommit) if $gitCommit;
$reviewer = "NOBODY (OO" . "PS!)" if !$reviewer;
print CHANGE_LOG " Reviewed by $reviewer.\n\n";
print CHANGE_LOG $description . "\n" if $description;
print CHANGE_LOG normalizeLineEndings(" Reviewed by $reviewer.\n\n", $endl);
print CHANGE_LOG normalizeLineEndings($description . "\n", $endl) if $description;
if ($prefix =~ m/WebCore/ || `pwd` =~ m/WebCore/) {
if ($didChangeRegressionTests) {
print CHANGE_LOG testListForChangeLog(sort @addedRegressionTests);
print CHANGE_LOG normalizeLineEndings(testListForChangeLog(sort @addedRegressionTests), $endl);
} else {
print CHANGE_LOG " WARNING: NO TEST CASES ADDED OR CHANGED\n\n";
print CHANGE_LOG normalizeLineEndings(" WARNING: NO TEST CASES ADDED OR CHANGED\n\n", $endl);
}
}
foreach my $file (sort @{$files{$prefix}}) {
my $file_stem = substr $file, length $prefix;
print CHANGE_LOG " * $file_stem:$function_lists{$file}\n";
my $file_stem = normalizePath(substr $file, length $prefix);
print CHANGE_LOG normalizeLineEndings(" * $file_stem:$function_lists{$file}\n", $endl);;
}
print CHANGE_LOG "\n", @old_change_log;
print CHANGE_LOG normalizeLineEndings("\n", $endl), @old_change_log;
close CHANGE_LOG;
}
......@@ -1452,3 +1460,17 @@ sub reviewerAndDescriptionForGitCommit($)
return ($reviewer, $description);
}
sub normalizeLineEndings($$)
{
my ($string, $endl) = @_;
$string =~ s/\r?\n/$endl/g;
return $string;
}
sub normalizePath($)
{
my ($path) = @_;
$path =~ s/\\/\//g;
return $path;
}
Markdown is supported
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