Use more sensible behavior in presubmit checks.
It's less annoying to type Y than to have to rerun the scripts with --no_presubmit for certain checks.
TEST=none
BUG=none
TBR=joi
Review URL: http://codereview.chromium.org/119284
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17838 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index 09439fb..ba8c3ed 100755
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -74,7 +74,7 @@
"""
for f, line_num, line in input_api.RightHandSideLines():
if '\t' in line:
- return [output_api.PresubmitError(
+ return [output_api.PresubmitPromptWarning(
"Found a tab character in %s, line %s" %
(f.LocalPath(), line_num))]
return []
@@ -103,14 +103,15 @@
def CheckTreeIsOpen(input_api, output_api, url, closed):
"""Checks that an url's content doesn't match a regexp that would mean that
the tree is closed."""
+ assert(input_api.is_committing)
try:
connection = input_api.urllib2.urlopen(url)
status = connection.read()
connection.close()
if input_api.re.match(closed, status):
long_text = status + '\n' + url
- return [output_api.PresubmitError("The tree is closed.",
- long_text=long_text)]
+ return [output_api.PresubmitPromptWarning("The tree is closed.",
+ long_text=long_text)]
except IOError:
pass
return []