Modified: trunk/Tools/ChangeLog (161283 => 161284)
--- trunk/Tools/ChangeLog 2014-01-03 21:28:24 UTC (rev 161283)
+++ trunk/Tools/ChangeLog 2014-01-03 21:40:41 UTC (rev 161284)
@@ -1,3 +1,26 @@
+2014-01-03 Bem Jones-Bey <[email protected]>
+
+ setup-git-clone fails to get email address from git
+ https://bugs.webkit.org/show_bug.cgi?id=126446
+
+ Reviewed by Ryosuke Niwa.
+
+ The setup-git-clone command fails to get an email address from git
+ because of a bug in VCSUtils. This patch fixes that bug, and also
+ makes it so that when VCSUtils fails for real because of a local
+ misconfiguration, the error message is actually presented to the user
+ of setup-git-clone.
+
+ * Scripts/VCSUtils.pm:
+ (gitConfig): Call isGit() instead of accessing $isGit directly to make
+ sure that $isGit is properly initialized.
+ * Scripts/webkitpy/tool/commands/setupgitclone.py:
+ (SetupGitClone.execute): Pull out username and email acquistion to
+ it's own method.
+ (SetupGitClone._get_username_and_email): Catch the exception thrown
+ when VCSUtils fails and print out the error message so that the
+ user actually knows why the command failed.
+
2014-01-03 Alexey Proskuryakov <[email protected]>
It feels too hard to get rid of a popover at build.webkit.org/dashboard
Modified: trunk/Tools/Scripts/VCSUtils.pm (161283 => 161284)
--- trunk/Tools/Scripts/VCSUtils.pm 2014-01-03 21:28:24 UTC (rev 161283)
+++ trunk/Tools/Scripts/VCSUtils.pm 2014-01-03 21:40:41 UTC (rev 161284)
@@ -1880,7 +1880,7 @@
sub gitConfig($)
{
- return unless $isGit;
+ return unless isGit();
my ($config) = @_;
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/setupgitclone.py (161283 => 161284)
--- trunk/Tools/Scripts/webkitpy/tool/commands/setupgitclone.py 2014-01-03 21:28:24 UTC (rev 161283)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/setupgitclone.py 2014-01-03 21:40:41 UTC (rev 161284)
@@ -28,8 +28,8 @@
from webkitpy.tool.multicommandtool import Command
from webkitpy.common.checkout.scm.git import Git
+from webkitpy.common.system.executive import ScriptError
-
class SetupGitClone(Command):
name = "setup-git-clone"
help_text = "Configures a new Git clone for the WebKit development"
@@ -43,6 +43,8 @@
print "There are local changes; aborting the command."
return
+ username, email = self._get_username_and_email(tool)
+
# FIXME: We shouldn't be using a privatd method
run_git = tool.scm()._run_git
run_git(["pull"])
@@ -50,18 +52,6 @@
run_git(["config", "--replace", "svn-remote.svn.fetch", "trunk:refs/remotes/origin/master"])
run_git(["svn", "fetch"])
- original_path = tool.filesystem.abspath(".")
-
- tool.filesystem.chdir("Tools/Scripts/")
- username = tool.executive.run_and_throw_if_fail(["perl", "-e", "use VCSUtils; print STDOUT changeLogName();"], quiet=True)
- if not username:
- username = tool.user.prompt("Your name:")
-
- email = tool.executive.run_and_throw_if_fail(["perl", "-e", "use VCSUtils; print STDOUT changeLogEmailAddress();"], quiet=True)
- if not email:
- email = tool.user.prompt("Your email address:")
- tool.filesystem.chdir(original_path)
-
run_git(["config", "user.name", username])
run_git(["config", "user.email", email])
@@ -84,3 +74,25 @@
print "You can override this option via git config branch.$branchName.webKitBranchBuild (true|false)"
print "Done"
+
+ def _get_username_and_email(self, tool):
+ try:
+ original_path = tool.filesystem.abspath(".")
+
+ tool.filesystem.chdir("Tools/Scripts/")
+ username = tool.executive.run_and_throw_if_fail(["perl", "-e", "use VCSUtils; print STDOUT changeLogName();"], quiet=True)
+ if not username:
+ username = tool.user.prompt("Your name:")
+
+ email = tool.executive.run_and_throw_if_fail(["perl", "-e", "use VCSUtils; print STDOUT changeLogEmailAddress();"], quiet=True)
+ if not email:
+ email = tool.user.prompt("Your email address:")
+
+ tool.filesystem.chdir(original_path)
+
+ return (username, email)
+ except ScriptError as error:
+ # VCSUtils prints useful error messages on failure, we shouldn't hide these
+ if error.output:
+ print error.output
+ raise