[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

mrowe at apple.com mrowe at apple.com
Wed Apr 7 23:25:36 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 264efc47bef0bdd307ff536d26273d7b6aa0c7e8
Author: mrowe at apple.com <mrowe at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Nov 8 03:59:28 2009 +0000

    Fix <https://bugs.webkit.org/show_bug.cgi?id=28168>.
    commit-log-editor does not support all the email address configurations that prepare-Changelog supports
    
    Reviewed by Darin Adler.
    
    Move logic for determining the name and email address to use in a ChangeLog entry from
    prepare-ChangeLog to VCSUtils so that commit-log-editor can use it.  It wants to check
    whether the author of the patch matches committer, and therefore needs access to the
    email address that would be used in a ChangeLog entry.
    
    Based on a patch by Pierre d'Herbemont.
    
    * Scripts/VCSUtils.pm:
    * Scripts/commit-log-editor:
    * Scripts/prepare-ChangeLog:
    * Scripts/webkitdirs.pm:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50619 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index daf1ade..b7f4a57 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,22 @@
+2009-11-07  Mark Rowe  <mrowe at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Fix <https://bugs.webkit.org/show_bug.cgi?id=28168>.
+        commit-log-editor does not support all the email address configurations that prepare-Changelog supports
+
+        Move logic for determining the name and email address to use in a ChangeLog entry from
+        prepare-ChangeLog to VCSUtils so that commit-log-editor can use it.  It wants to check
+        whether the author of the patch matches committer, and therefore needs access to the
+        email address that would be used in a ChangeLog entry.
+
+        Based on a patch by Pierre d'Herbemont.
+
+        * Scripts/VCSUtils.pm:
+        * Scripts/commit-log-editor:
+        * Scripts/prepare-ChangeLog:
+        * Scripts/webkitdirs.pm:
+
 2009-11-06  Anantanarayanan G Iyengar  <ananta at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/WebKitTools/Scripts/VCSUtils.pm b/WebKitTools/Scripts/VCSUtils.pm
index d94521e..abf7335 100644
--- a/WebKitTools/Scripts/VCSUtils.pm
+++ b/WebKitTools/Scripts/VCSUtils.pm
@@ -41,6 +41,8 @@ BEGIN {
     @ISA         = qw(Exporter);
     @EXPORT      = qw(
         &canonicalizePath
+        &changeLogEmailAddress
+        &changeLogName
         &chdirReturningRelativePath
         &determineSVNRoot
         &determineVCSRoot
@@ -415,4 +417,61 @@ sub fixChangeLogPatch($)
     return join($lineEnding, @patchLines) . "\n"; # patch(1) expects an extra trailing newline.
 }
 
+sub gitConfig($)
+{
+    return unless $isGit;
+
+    my ($config) = @_;
+
+    my $result = `git config $config`;
+    if (($? >> 8)) {
+        $result = `git repo-config $config`;
+    }
+    chomp $result;
+    return $result;
+}
+
+sub changeLogNameError($)
+{
+    my ($message) = @_;
+    print STDERR "$message\nEither:\n";
+    print STDERR "  set CHANGE_LOG_NAME in your environment\n";
+    print STDERR "  OR pass --name= on the command line\n";
+    print STDERR "  OR set REAL_NAME in your environment";
+    print STDERR "  OR git users can set 'git config user.name'\n";
+    exit(1);
+}
+
+sub changeLogName()
+{
+    my $name = $ENV{CHANGE_LOG_NAME} || $ENV{REAL_NAME} || gitConfig("user.name") || (split /\s*,\s*/, (getpwuid $<)[6])[0];
+
+    changeLogNameError("Failed to determine ChangeLog name.") unless $name;
+    # getpwuid seems to always succeed on windows, returning the username instead of the full name.  This check will catch that case.
+    changeLogNameError("'$name' does not contain a space!  ChangeLogs should contain your full name.") unless ($name =~ /\w \w/);
+
+    return $name;
+}
+
+sub changeLogEmailAddressError($)
+{
+    my ($message) = @_;
+    print STDERR "$message\nEither:\n";
+    print STDERR "  set CHANGE_LOG_EMAIL_ADDRESS in your environment\n";
+    print STDERR "  OR pass --email= on the command line\n";
+    print STDERR "  OR set EMAIL_ADDRESS in your environment\n";
+    print STDERR "  OR git users can set 'git config user.email'\n";
+    exit(1);
+}
+
+sub changeLogEmailAddress()
+{
+    my $emailAddress = $ENV{CHANGE_LOG_EMAIL_ADDRESS} || $ENV{EMAIL_ADDRESS} || gitConfig("user.email");
+
+    changeLogEmailAddressError("Failed to determine email address for ChangeLog.") unless $emailAddress;
+    changeLogEmailAddressError("Email address '$emailAddress' does not contain '\@' and is likely invalid.") unless ($emailAddress =~ /\@/);
+
+    return $emailAddress;
+}
+
 1;
diff --git a/WebKitTools/Scripts/commit-log-editor b/WebKitTools/Scripts/commit-log-editor
index e58b181..18d682f 100755
--- a/WebKitTools/Scripts/commit-log-editor
+++ b/WebKitTools/Scripts/commit-log-editor
@@ -170,7 +170,8 @@ for my $changeLog (@changeLogs) {
 
             # Attempt to insert the "patch by" line, after the first blank line.
             if ($previousLineWasBlank && $hasAuthorInfoToWrite && $lineCount > 0) {
-                my $authorAndCommitterAreSamePerson = $ENV{EMAIL_ADDRESS} && $email eq $ENV{EMAIL_ADDRESS};
+                my $committerEmail = changeLogEmailAddress();
+                my $authorAndCommitterAreSamePerson = $email eq $committerEmail;
                 if (!$authorAndCommitterAreSamePerson) {
                     $contents .= "Patch by $author <$email> on $date\n";
                     $hasAuthorInfoToWrite = 0;
diff --git a/WebKitTools/Scripts/prepare-ChangeLog b/WebKitTools/Scripts/prepare-ChangeLog
index dd864df..4c59af9 100755
--- a/WebKitTools/Scripts/prepare-ChangeLog
+++ b/WebKitTools/Scripts/prepare-ChangeLog
@@ -65,8 +65,8 @@ use POSIX qw(strftime);
 use VCSUtils;
 
 sub changeLogDate($);
-sub changeLogEmailAddress($);
-sub changeLogName($);
+sub changeLogEmailAddressFromArgs($);
+sub changeLogNameFromArgs($);
 sub firstDirectoryOrCwd();
 sub diffFromToString();
 sub diffCommand(@);
@@ -77,7 +77,6 @@ sub findOriginalFileFromSvn($);
 sub determinePropertyChanges($$$);
 sub pluralizeAndList($$@);
 sub generateFileList(\@\@\%);
-sub gitConfig($);
 sub isUnmodifiedStatus($);
 sub isModifiedStatus($);
 sub isAddedStatus($);
@@ -246,8 +245,8 @@ if (%changed_line_ranges) {
 
 # Get some parameters for the ChangeLog we are about to write.
 my $date = changeLogDate($changeLogTimeZone);
-$name = changeLogName($name);
-$emailAddress = changeLogEmailAddress($emailAddress);
+$name = changeLogNameFromArgs($name);
+$emailAddress = changeLogEmailAddressFromArgs($emailAddress);
 
 print STDERR "  Change author: $name <$emailAddress>.\n";
 
@@ -443,62 +442,22 @@ sub changeLogDate($)
     return $date;
 }
 
-sub changeLogNameError($)
-{
-    my ($message) = @_;
-    print STDERR "$message\nEither:\n";
-    print STDERR "  set CHANGE_LOG_NAME in your environment\n";
-    print STDERR "  OR pass --name= on the command line\n";
-    print STDERR "  OR set REAL_NAME in your environment";
-    print STDERR "  OR git users can set 'git config user.name'\n";
-    exit(1);
-}
-
-sub changeLogName($)
+sub changeLogNameFromArgs($)
 {
     my ($nameFromArgs) = @_;
-    # Silently allow --git-commit to win, we could warn if $emailAddressFromArgs is defined.
+    # Silently allow --git-commit to win, we could warn if $nameFromArgs is defined.
     return `$GIT log --max-count=1 --pretty=\"format:%an\" \"$gitCommit\"` if $gitCommit;
 
-    my $name = $nameFromArgs
-        || $ENV{CHANGE_LOG_NAME}
-        || $ENV{REAL_NAME}
-        || gitConfig("user.name")
-        || (split /\s*,\s*/, (getpwuid $<)[6])[0];
-
-    changeLogNameError("Failed to determine ChangeLog name.") unless $name;
-    # getpwuid seems to always succeed on windows, returning the username instead of the full name.  This check will catch that case.
-    changeLogNameError("'$name' does not contain a space!  ChangeLogs should contain your full name.") unless ($name =~ /\w \w/);
-
-    return $name;
-}
-
-sub changeLogEmailAddressError($)
-{
-    my ($message) = @_;
-    print STDERR "$message\nEither:\n";
-    print STDERR "  set CHANGE_LOG_EMAIL_ADDRESS in your environment\n";
-    print STDERR "  OR pass --email= on the command line\n";
-    print STDERR "  OR set EMAIL_ADDRESS in your environment\n";
-    print STDERR "  OR git users can set 'git config user.email'\n";
-    exit(1);
+    return $nameFromArgs || changeLogName();
 }
 
-sub changeLogEmailAddress($)
+sub changeLogEmailAddressFromArgs($)
 {
     my ($emailAddressFromArgs) = @_;
     # Silently allow --git-commit to win, we could warn if $emailAddressFromArgs is defined.
     return `$GIT log --max-count=1 --pretty=\"format:%ae\" \"$gitCommit\"` if $gitCommit;
 
-    my $emailAddress = $emailAddressFromArgs
-        || $ENV{CHANGE_LOG_EMAIL_ADDRESS}
-        || $ENV{EMAIL_ADDRESS}
-        || gitConfig("user.email");
-
-    changeLogEmailAddressError("Failed to determine email address for ChangeLog.") unless $emailAddress;
-    changeLogEmailAddressError("Email address '$emailAddress' does not contain '\@' and is likely invalid.") unless ($emailAddress =~ /\@/);
-
-    return $emailAddress;
+    return $emailAddressFromArgs || changeLogEmailAddress();
 }
 
 sub get_function_line_ranges($$)
@@ -1477,20 +1436,6 @@ sub generateFileList(\@\@\%)
     close STAT;
 }
 
-sub gitConfig($)
-{
-    return unless $isGit;
-
-    my ($config) = @_;
-
-    my $result = `$GIT config $config`;
-    if (($? >> 8) != 0) {
-        $result = `$GIT repo-config $config`;
-    }
-    chomp $result;
-    return $result;
-}
-
 sub isUnmodifiedStatus($)
 {
     my ($status) = @_;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list