https://bugs.webkit.org/show_bug.cgi?id=76956
Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-01-26
Reviewed by Kentaro Hara.
Modify the tools used to generate, edit and resolve ChangeLogs to support
the addition of a suffix to the ChangeLog filename.
This patch makes it easier to support alternate ChangeLog files in branches.
* Scripts/VCSUtils.pm:
(changeLogSuffix):
(changeLogFileName):
* Scripts/commit-log-editor:
* Scripts/prepare-ChangeLog:
(getLatestChangeLogs):
(generateNewChangeLogs):
(generateFileList):
* Scripts/resolve-ChangeLogs:
(findChangeLog):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106054
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-26 Benjamin Poulain <bpoulain@apple.com>
+
+ Support a suffix on ChangeLog filenames based on a configuration file
+ https://bugs.webkit.org/show_bug.cgi?id=76956
+
+ Reviewed by Kentaro Hara.
+
+ Modify the tools used to generate, edit and resolve ChangeLogs to support
+ the addition of a suffix to the ChangeLog filename.
+
+ This patch makes it easier to support alternate ChangeLog files in branches.
+
+ * Scripts/VCSUtils.pm:
+ (changeLogSuffix):
+ (changeLogFileName):
+ * Scripts/commit-log-editor:
+ * Scripts/prepare-ChangeLog:
+ (getLatestChangeLogs):
+ (generateNewChangeLogs):
+ (generateFileList):
+ * Scripts/resolve-ChangeLogs:
+ (findChangeLog):
+
2012-01-26 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r106038.
&callSilently
&canonicalizePath
&changeLogEmailAddress
+ &changeLogFileName
&changeLogName
&chdirReturningRelativePath
&decodeGitBinaryChunk
return $result;
}
+sub changeLogSuffix()
+{
+ my $rootPath = determineVCSRoot();
+ my $changeLogSuffixFile = File::Spec->catfile($rootPath, ".changeLogSuffix");
+ return "" if ! -e $changeLogSuffixFile;
+ open FILE, $changeLogSuffixFile or die "Could not open $changeLogSuffixFile: $!";
+ my $changeLogSuffix = <FILE>;
+ chomp $changeLogSuffix;
+ close FILE;
+ return $changeLogSuffix;
+}
+
+sub changeLogFileName()
+{
+ return "ChangeLog" . changeLogSuffix()
+}
+
sub changeLogNameError($)
{
my ($message) = @_;
# (without the log comment info). We don't need it.
}
$existingLog = isGit() && !(/^#/ || /^\s*$/) unless $existingLog;
-
- push @changeLogs, makeFilePathRelative($1) if $inChangesToBeCommitted && (/^(?:M|A)....(.*ChangeLog)\r?\n?$/ || /^#\t(?:modified|new file): (.*ChangeLog)$/) && !/-ChangeLog$/;
+ my $changeLogFileName = changeLogFileName();
+ push @changeLogs, makeFilePathRelative($1) if $inChangesToBeCommitted && (/^(?:M|A)....(.*$changeLogFileName)\r?\n?$/ || /^#\t(?:modified|new file): (.*$changeLogFileName)$/) && !/-$changeLogFileName$/;
}
close LOG;
my @changeLogs = ();
foreach my $prefix (@$prefixes) {
- push @changeLogs, File::Spec->catfile($prefix || ".", "ChangeLog");
+ push @changeLogs, File::Spec->catfile($prefix || ".", changeLogFileName());
}
return \@changeLogs;
}
my @old_change_log;
if ($writeChangeLogs) {
- my $changeLogPath = File::Spec->catfile($prefix || ".", "ChangeLog");
+ my $changeLogPath = File::Spec->catfile($prefix || ".", changeLogFileName());
print STDERR " Editing the ${changeLogPath} file.\n";
open OLD_CHANGE_LOG, ${changeLogPath} or die "Could not open ${changeLogPath} file: $!.\n";
# It's less efficient to read the whole thing into memory than it would be
&& !scalar(grep(/^resources$/i, @components))
&& !scalar(grep(/^script-tests$/i, @components));
}
- push @changedFiles, $file if $components[$#components] ne "ChangeLog";
+ push @changedFiles, $file if $components[$#components] ne changeLogFileName();
} elsif (isConflictStatus($status, $gitCommit, $gitIndex) || isConflictStatus($propertyStatus, $gitCommit, $gitIndex)) {
push @conflictFiles, $file;
}
- if (basename($file) ne "ChangeLog") {
+ if (basename($file) ne changeLogFileName()) {
my $description = statusDescription($status, $propertyStatus, $original, $propertyChanges);
$functionLists{$file} = $description if defined $description;
}
sub findChangeLog($)
{
- return $_[0] if basename($_[0]) eq "ChangeLog";
+ my $changeLogFileName = changeLogFileName();
+ return $_[0] if basename($_[0]) eq $changeLogFileName;
- my $file = File::Spec->catfile($_[0], "ChangeLog");
+ my $file = File::Spec->catfile($_[0], $changeLogFileName);
return $file if -d $_[0] and -e $file;
return undef;