Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: PRESUBMIT.py

Issue 13932026: If the tree is closed then print information about contacting the sheriff (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
===================================================================
--- PRESUBMIT.py (revision 8610)
+++ PRESUBMIT.py (working copy)
@@ -13,6 +13,9 @@
import sys
+SKIA_TREE_STATUS_URL = 'http://skia-tree-status.appspot.com'
+
+
def _CheckChangeHasEol(input_api, output_api, source_file_filter=None):
"""Checks that files end with atleast one \n (LF)."""
eof_files = []
@@ -80,6 +83,16 @@
tree_status_results.append(
output_api.PresubmitPromptWarning(
message=short_text, long_text=long_text))
+ else:
+ # Tree status is closed. Put in message about contacting sheriff.
+ connection = input_api.urllib2.urlopen(
+ SKIA_TREE_STATUS_URL + '/current-sheriff')
+ sheriff_details = input_api.json.loads(connection.read())
+ if sheriff_details:
+ tree_status_results[0]._message += (
+ '\n\nPlease contact the current Skia sheriff (%s) if you are trying '
+ 'to submit a build fix\nand do not know how to submit because the '
+ 'tree is closed') % sheriff_details['username']
return tree_status_results
@@ -96,5 +109,5 @@
results.extend(_CommonChecks(input_api, output_api))
results.extend(
_CheckTreeStatus(input_api, output_api, json_url=(
- 'http://skia-tree-status.appspot.com/banner-status?format=json')))
+ SKIA_TREE_STATUS_URL + '/banner-status?format=json')))
return results
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698