diff options
author | Steve Block <steveblock@google.com> | 2010-04-27 16:31:00 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-05-11 14:42:12 +0100 |
commit | dcc8cf2e65d1aa555cce12431a16547e66b469ee (patch) | |
tree | 92a8d65cd5383bca9749f5327fb5e440563926e6 /WebKitTools/Scripts/commit-log-editor | |
parent | ccac38a6b48843126402088a309597e682f40fe6 (diff) | |
download | external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2 |
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebKitTools/Scripts/commit-log-editor')
-rwxr-xr-x | WebKitTools/Scripts/commit-log-editor | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/WebKitTools/Scripts/commit-log-editor b/WebKitTools/Scripts/commit-log-editor index 75017e3..a642731 100755 --- a/WebKitTools/Scripts/commit-log-editor +++ b/WebKitTools/Scripts/commit-log-editor @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. # Copyright (C) 2009 Torch Mobile Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,6 +40,7 @@ use webkitdirs; sub normalizeLineEndings($$); sub removeLongestCommonPrefixEndingInDoubleNewline(\%); +sub isCommitLogEditor($); sub usage { @@ -61,30 +62,33 @@ if (!$log) { my $baseDir = baseProductDir(); my $editor = $ENV{SVN_LOG_EDITOR}; -if (!$editor) { +if (!$editor || isCommitLogEditor($editor)) { $editor = $ENV{CVS_LOG_EDITOR}; } -if (!$editor) { +if (!$editor || isCommitLogEditor($editor)) { my $builtEditorApplication = "$baseDir/Release/Commit Log Editor.app/Contents/MacOS/Commit Log Editor"; $editor = $builtEditorApplication if -x $builtEditorApplication; } -if (!$editor) { +if (!$editor || isCommitLogEditor($editor)) { my $builtEditorApplication = "$baseDir/Debug/Commit Log Editor.app/Contents/MacOS/Commit Log Editor"; $editor = $builtEditorApplication if -x $builtEditorApplication; } -if (!$editor) { +if (!$editor || isCommitLogEditor($editor)) { my $installedEditorApplication = "$ENV{HOME}/Applications/Commit Log Editor.app/Contents/MacOS/Commit Log Editor"; $editor = $installedEditorApplication if -x $installedEditorApplication; } -if (!$editor) { - $editor = $ENV{EDITOR} || "/usr/bin/vi"; +if (!$editor || isCommitLogEditor($editor)) { + $editor = $ENV{EDITOR}; +} +if (!$editor || isCommitLogEditor($editor)) { + $editor = "/usr/bin/vi"; } my $inChangesToBeCommitted = !isGit(); my @changeLogs = (); my $logContents = ""; my $existingLog = 0; -open LOG, $log or die; +open LOG, $log or die "Could not open the log file."; while (<LOG>) { if (isGit()) { if (/^# Changes to be committed:$/) { @@ -102,7 +106,7 @@ while (<LOG>) { } $existingLog = isGit() && !(/^#/ || /^\s*$/) unless $existingLog; - push @changeLogs, makeFilePathRelative($1) if $inChangesToBeCommitted && (/^M....(.*ChangeLog)\r?\n?$/ || /^#\tmodified: (.*ChangeLog)/) && !/-ChangeLog/; + push @changeLogs, makeFilePathRelative($1) if $inChangesToBeCommitted && (/^(?:M|A)....(.*ChangeLog)\r?\n?$/ || /^#\t(?:modified|new file): (.*ChangeLog)$/) && !/-ChangeLog$/; } close LOG; @@ -151,8 +155,8 @@ for my $changeLog (@changeLogs) { # Remove indentation spaces $line =~ s/^ {8}//; - # Save the reviewed by line - if ($line =~ m/^Reviewed by .*/) { + # Save the reviewed / rubber stamped by line. + if ($line =~ m/^Reviewed by .*/ || $line =~ m/^Rubber[ \-]?stamped by .*/) { $reviewedByLine = $line; next; } @@ -184,7 +188,6 @@ for my $changeLog (@changeLogs) { $reviewedByLine = ""; } - $lineCount++; $contents .= $line; } else { @@ -204,12 +207,6 @@ for my $changeLog (@changeLogs) { my $sortKey = lc $label; if ($label eq "top level") { $sortKey = ""; - } elsif ($label eq "Tools") { - $sortKey = "-, just after top level"; - } elsif ($label eq "WebBrowser") { - $sortKey = lc "WebKit, WebBrowser after"; - } elsif ($label eq "WebCore") { - $sortKey = lc "WebFoundation, WebCore after"; } elsif ($label eq "LayoutTests") { $sortKey = lc "~, LayoutTests last"; } @@ -307,3 +304,9 @@ sub removeLongestCommonPrefixEndingInDoubleNewline(\%) } return substr($prefix, 0, $lastDoubleNewline + 2); } + +sub isCommitLogEditor($) +{ + my $editor = shift; + return $editor =~ m/commit-log-editor/; +} |