Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: git_cl/git_cl.py

Issue 6679032: Fix prompting - had the logic backwards (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl/git_cl.py
diff --git a/git_cl/git_cl.py b/git_cl/git_cl.py
index 0c50651ad4432af1bddc729dc1bf5b673c8f62f1..50e7c9a98d996b01daddcaf268c55a3e1ce20ef2 100644
--- a/git_cl/git_cl.py
+++ b/git_cl/git_cl.py
@@ -778,7 +778,7 @@ def RunHook(committing, upstream_branch, rietveld_server, tbr, may_prompt):
'rietveld.extracc', ','.join(watchers)])
output = StringIO.StringIO()
- res = presubmit_support.DoPresubmitChecks(change, committing,
+ should_continue = presubmit_support.DoPresubmitChecks(change, committing,
verbose=None, output_stream=output, input_stream=sys.stdin,
default_presubmit=None, may_prompt=False, tbr=tbr,
host_url=cl.GetRietveldServer())
@@ -787,11 +787,12 @@ def RunHook(committing, upstream_branch, rietveld_server, tbr, may_prompt):
print hook_results.output
# TODO(dpranke): We should propagate the error out instead of calling exit().
- if not res and ('** Presubmit ERRORS **' in hook_results.output or
- '** Presubmit WARNINGS **' in hook_results.output):
- res = True
+ if should_continue and hook_results.output and (
+ '** Presubmit ERRORS **\n' in hook_results.output or
+ '** Presubmit WARNINGS **\n' in hook_results.output):
+ should_continue = False
- if res:
+ if not should_continue:
if may_prompt:
response = raw_input('Are you sure you want to continue? (y/N): ')
if not response.lower().startswith('y'):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698