summaryrefslogtreecommitdiff
path: root/Tools/Scripts/webkitpy/tool/steps/commit.py
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
commitcd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch)
tree8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Tools/Scripts/webkitpy/tool/steps/commit.py
parentd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff)
downloadqtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Tools/Scripts/webkitpy/tool/steps/commit.py')
-rw-r--r--Tools/Scripts/webkitpy/tool/steps/commit.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Tools/Scripts/webkitpy/tool/steps/commit.py b/Tools/Scripts/webkitpy/tool/steps/commit.py
index 08a7310bf..e8fc392ba 100644
--- a/Tools/Scripts/webkitpy/tool/steps/commit.py
+++ b/Tools/Scripts/webkitpy/tool/steps/commit.py
@@ -50,11 +50,30 @@ class Commit(AbstractStep):
'To avoid this prompt, set "git config webkit-patch.commit-should-always-squash true".' % (
error.num_local_commits, working_directory_message))
+ def _check_test_expectations(self, changed_files):
+ test_expectations_files = []
+ for filename in changed_files:
+ if filename.endswith('test_expectations.txt'):
+ test_expectations_files.append(filename)
+
+ if not test_expectations_files:
+ return
+
+ args = ["--diff-files"]
+ args.extend(test_expectations_files)
+ try:
+ self._tool.executive.run_and_throw_if_fail(self._tool.port().check_webkit_style_command() + args, cwd=self._tool.scm().checkout_root)
+ except ScriptError, e:
+ if not self._tool.user.confirm("Are you sure you want to continue?", default="n"):
+ exit(1)
+
def run(self, state):
self._commit_message = self._tool.checkout().commit_message_for_this_commit(self._options.git_commit).message()
if len(self._commit_message) < 10:
raise Exception("Attempted to commit with a commit message shorter than 10 characters. Either your patch is missing a ChangeLog or webkit-patch may have a bug.")
+ self._check_test_expectations(self._changed_files(state))
+
self._state = state
username = None