Commit 07bbc214 authored by maruel@chromium.org's avatar maruel@chromium.org

Actually make use of the may_prompt flag.

This is annoying when using gcl presubmit.

TEST=unit test
BUG=none
Review URL: http://codereview.chromium.org/122010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@18141 0039d316-1c4b-4281-b951-d872f2087c98
parent df1595ac
......@@ -767,7 +767,7 @@ def DoPresubmitChecks(change_info,
may_prompt=False):
error_count += 1
output_stream.write('\n')
if not errors and warnings:
if not errors and warnings and may_prompt:
output_stream.write(
'There were presubmit warnings. Sure you want to continue? (y/N): ')
response = input_stream.readline()
......
......@@ -380,7 +380,7 @@ class PresubmitUnittest(PresubmitTestsBase):
output = StringIO.StringIO()
input = StringIO.StringIO('n\n') # say no to the warning
self.failIf(presubmit.DoPresubmitChecks(ci, False, True, output, input,
None, False))
None, True))
self.assertEqual(output.getvalue().count('??'), 2)
output = StringIO.StringIO()
......@@ -391,7 +391,7 @@ class PresubmitUnittest(PresubmitTestsBase):
output,
input,
None,
False))
True))
self.assertEquals(output.getvalue().count('??'), 2)
def testDoPresubmitChecksNoWarningPromptIfErrors(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment