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

Unified Diff: git_number.py

Issue 534703002: Require 'CHROME_HEADLESS' to use 'git-number'. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Updated environment check. Created 6 years, 3 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: git_number.py
diff --git a/git_number.py b/git_number.py
index 7fa0398af775abfafa33caa1e803ffe508fcbf23..6997f51b3d0ffd6a21383949315ff7dbdcd6109d 100755
--- a/git_number.py
+++ b/git_number.py
@@ -252,6 +252,13 @@ def main(): # pragma: no cover
levels = [logging.ERROR, logging.INFO, logging.DEBUG]
logging.basicConfig(level=levels[min(opts.verbose, len(levels) - 1)])
+ # 'git number' should only be used on bots.
+ if os.getenv('CHROME_HEADLESS') != '1':
+ logging.error("'git-number' is an infrastructure tool that is only "
+ "intended to be used internally by bots. Developers should "
+ "use the 'Cr-Commit-Position' value in the commit's message.")
+ return 1
+
try:
if opts.reset:
clear_caches(on_disk=True)
« 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