Index: PRESUBMIT.py |
diff --git a/PRESUBMIT.py b/PRESUBMIT.py |
index 819331f9e5b33d2ea65e33c49e979847767db07f..75e16e3bd79df3876e046983ee9c645cde0c9be0 100644 |
--- a/PRESUBMIT.py |
+++ b/PRESUBMIT.py |
@@ -58,6 +58,17 @@ def _CommonChecks(input_api, output_api): |
return results |
+def _SkipTreeCheck(input_api, output_api): |
+ """Check the env var whether we want to skip tree check. |
+ Only skip if src/version.cc has been updated.""" |
+ src_version = 'src/version.cc' |
+ FilterFile = lambda file: file.LocalPath() == src_version |
+ if not input_api.AffectedSourceFiles( |
+ lambda file: file.LocalPath() == src_version): |
+ return False |
+ return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip' |
+ |
+ |
def CheckChangeOnUpload(input_api, output_api): |
results = [] |
results.extend(_CommonChecks(input_api, output_api)) |
@@ -69,7 +80,8 @@ def CheckChangeOnCommit(input_api, output_api): |
results.extend(_CommonChecks(input_api, output_api)) |
results.extend(input_api.canned_checks.CheckChangeHasDescription( |
input_api, output_api)) |
- results.extend(input_api.canned_checks.CheckTreeIsOpen( |
- input_api, output_api, |
- json_url='http://v8-status.appspot.com/current?format=json')) |
+ if not _SkipTreeCheck(input_api, output_api): |
+ results.extend(input_api.canned_checks.CheckTreeIsOpen( |
+ input_api, output_api, |
+ json_url='http://v8-status.appspot.com/current?format=json')) |
return results |