Chromium Code Reviews| Index: git_cl/git_cl.py |
| diff --git a/git_cl/git_cl.py b/git_cl/git_cl.py |
| index e1e73b6f34356a2f2c81887a2cca85c763325e5e..083db6074d7c5fa72245489b2d6e33437624042c 100644 |
| --- a/git_cl/git_cl.py |
| +++ b/git_cl/git_cl.py |
| @@ -720,7 +720,7 @@ def UserEditedLog(starting_text): |
| if not result: |
| return |
| - |
| + |
| stripcomment_re = re.compile(r'^#.*$', re.MULTILINE) |
| return stripcomment_re.sub('', result).strip() |
| @@ -775,15 +775,26 @@ def RunHook(committing, upstream_branch, rietveld_server, tbr, may_prompt): |
| output = StringIO.StringIO() |
| res = presubmit_support.DoPresubmitChecks(change, committing, |
| verbose=None, output_stream=output, input_stream=sys.stdin, |
| - default_presubmit=None, may_prompt=may_prompt, tbr=tbr, |
| + default_presubmit=None, may_prompt=False, tbr=tbr, |
| host_url=cl.GetRietveldServer()) |
| hook_results = HookResults(output.getvalue()) |
| if hook_results.output: |
| print hook_results.output |
| # TODO(dpranke): We should propagate the error out instead of calling exit(). |
| - if not res: |
| - sys.exit(1) |
| + if not res and ('** Presubmit ERRORS **' in hook_results.output or |
|
M-A Ruel
2011/03/12 15:37:31
with '\n' ?
Dirk Pranke
2011/03/12 22:47:47
I don't understand this comment?
M-A Ruel
2011/03/13 00:53:00
I meant to use '** Presubmit ERRORS **\n' so that
|
| + '** Presubmit WARNINGS **' in hook_results.output): |
| + res = True |
| + |
| + if res: |
| + if may_prompt: |
| + response = raw_input('Are you sure you want to continue? (y/N): ') |
| + if not response.lower().startswith('y'): |
| + sys.exit(1) |
| + else: |
| + sys.exit(1) |
| + |
|
M-A Ruel
2011/03/12 15:37:31
remove one extra line.
|
| + |
| return hook_results |