Report computation time before showing a prompt, so the response time

isn't included in the calculation.

BUG=none
TEST=submit change with presubmit warning, note reported time

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@25806 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
pam@chromium.org 16 years ago
parent b671b22335
commit ed9a083365

@ -866,6 +866,11 @@ def DoPresubmitChecks(change,
may_prompt=False): may_prompt=False):
error_count += 1 error_count += 1
output_stream.write('\n') output_stream.write('\n')
total_time = time.time() - start_time
if total_time > 1.0:
print "Presubmit checks took %.1fs to calculate." % total_time
if not errors and warnings and may_prompt: 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): ')
@ -873,9 +878,6 @@ def DoPresubmitChecks(change,
if response.strip().lower() != 'y': if response.strip().lower() != 'y':
error_count += 1 error_count += 1
total_time = time.time() - start_time
if total_time > 1.0:
print "Presubmit checks took %.1fs to calculate." % total_time
global _ASKED_FOR_FEEDBACK global _ASKED_FOR_FEEDBACK
# Ask for feedback one time out of 5. # Ask for feedback one time out of 5.
if (len(results) and random.randint(0, 4) == 0 and not _ASKED_FOR_FEEDBACK): if (len(results) and random.randint(0, 4) == 0 and not _ASKED_FOR_FEEDBACK):

Loading…
Cancel
Save