Update presubmit feedback message for Cog

We shouldn't be suggesting people run unsupported commands on cog.

Change-Id: I0a15b825b32a3f9bc40c65e0b51be33f06de54ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5782965
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
changes/65/5782965/4
Gavin Mak 8 months ago committed by LUCI CQ
parent 39ca85acf5
commit 37a737c1bc

@ -2020,11 +2020,18 @@ def DoPresubmitChecks(change,
global _ASKED_FOR_FEEDBACK
# Ask for feedback one time out of 5.
if (results and random.randint(0, 4) == 0 and not _ASKED_FOR_FEEDBACK):
sys.stdout.write(
'Was the presubmit check useful? If not, run "git cl presubmit -v"\n'
'to figure out which PRESUBMIT.py was run, then run git blame\n'
'on the file to figure out who to ask for help.\n')
_ASKED_FOR_FEEDBACK = True
if gclient_utils.IsEnvCog():
sys.stdout.write(
'Was the presubmit check useful? If not, view the file\'s\n'
'blame on Code Search to figure out who to ask for help.\n')
else:
sys.stdout.write(
'Was the presubmit check useful? If not, run '
'"git cl presubmit -v"\n'
'to figure out which PRESUBMIT.py was run, then run '
'"git blame"\n'
'on the file to figure out who to ask for help.\n')
return 1 if presubmits_failed else 0

@ -888,7 +888,7 @@ def CheckChangeOnCommit(input_api, output_api):
'** Presubmit ERRORS: 1 **\n!!\n\n'
'There were Python 3 presubmit errors.\n'
'Was the presubmit check useful? If not, run "git cl presubmit -v"\n'
'to figure out which PRESUBMIT.py was run, then run git blame\n'
'to figure out which PRESUBMIT.py was run, then run "git blame"\n'
'on the file to figure out who to ask for help.\n')
self.assertEqual(sys.stdout.getvalue(), text)

Loading…
Cancel
Save