| Index: tools/auto_bisect/PRESUBMIT.py
|
| diff --git a/tools/auto_bisect/PRESUBMIT.py b/tools/auto_bisect/PRESUBMIT.py
|
| index 0cfdd189ddc7911097dd8eefac3f739672c816c8..6fc3c6ecefb55825ec6a7690663b61a5cdcb647f 100644
|
| --- a/tools/auto_bisect/PRESUBMIT.py
|
| +++ b/tools/auto_bisect/PRESUBMIT.py
|
| @@ -12,13 +12,12 @@ import imp
|
| import subprocess
|
| import os
|
|
|
| -# Paths to bisect config files relative to src/tools.
|
| +# Paths to bisect config files relative to this script.
|
| CONFIG_FILES = [
|
| - 'auto_bisect/config.cfg',
|
| - 'run-perf-test.cfg'
|
| + 'bisect.cfg',
|
| + os.path.join(os.path.pardir, 'run-perf-test.cfg'),
|
| ]
|
|
|
| -
|
| def CheckChangeOnUpload(input_api, output_api):
|
| return _CommonChecks(input_api, output_api)
|
|
|
| @@ -39,10 +38,10 @@ def _CommonChecks(input_api, output_api):
|
| def _CheckAllConfigFiles(input_api, output_api):
|
| """Checks all bisect config files and returns a list of presubmit results."""
|
| results = []
|
| - for f in input_api.AffectedFiles():
|
| - for config_file in CONFIG_FILES:
|
| - if f.LocalPath().endswith(config_file):
|
| - results.extend(_CheckConfigFile(config_file, output_api))
|
| + script_path = input_api.PresubmitLocalPath()
|
| + for config_file in CONFIG_FILES:
|
| + file_path = os.path.join(script_path, config_file)
|
| + results.extend(_CheckConfigFile(file_path, output_api))
|
| return results
|
|
|
|
|
| @@ -54,7 +53,7 @@ def _CheckConfigFile(file_path, output_api):
|
| warning = 'Failed to read config file %s: %s' % (file_path, str(e))
|
| return [output_api.PresubmitError(warning, items=[file_path])]
|
|
|
| - if not hasattr(config_file.config):
|
| + if not hasattr(config_file, 'config'):
|
| warning = 'Config file has no "config" global variable: %s' % str(e)
|
| return [output_api.PresubmitError(warning, items=[file_path])]
|
|
|
|
|