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
experimental/szager/collated-output
maruel@chromium.org 17 years ago
parent df1595ac20
commit 07bbc21467

@ -767,7 +767,7 @@ def DoPresubmitChecks(change_info,
may_prompt=False): may_prompt=False):
error_count += 1 error_count += 1
output_stream.write('\n') output_stream.write('\n')
if not errors and warnings: if not errors and warnings and may_prompt:
output_stream.write( output_stream.write(
'There were presubmit warnings. Sure you want to continue? (y/N): ') 'There were presubmit warnings. Sure you want to continue? (y/N): ')
response = input_stream.readline() response = input_stream.readline()

@ -380,7 +380,7 @@ class PresubmitUnittest(PresubmitTestsBase):
output = StringIO.StringIO() output = StringIO.StringIO()
input = StringIO.StringIO('n\n') # say no to the warning input = StringIO.StringIO('n\n') # say no to the warning
self.failIf(presubmit.DoPresubmitChecks(ci, False, True, output, input, self.failIf(presubmit.DoPresubmitChecks(ci, False, True, output, input,
None, False)) None, True))
self.assertEqual(output.getvalue().count('??'), 2) self.assertEqual(output.getvalue().count('??'), 2)
output = StringIO.StringIO() output = StringIO.StringIO()
@ -391,7 +391,7 @@ class PresubmitUnittest(PresubmitTestsBase):
output, output,
input, input,
None, None,
False)) True))
self.assertEquals(output.getvalue().count('??'), 2) self.assertEquals(output.getvalue().count('??'), 2)
def testDoPresubmitChecksNoWarningPromptIfErrors(self): def testDoPresubmitChecksNoWarningPromptIfErrors(self):

Loading…
Cancel
Save