From 04600b4f26bdd5534788d437d0f82a5a47d97deb Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Fri, 15 Mar 2019 03:03:41 +0000 Subject: [PATCH] Expose gclient_paths via InputAPI. The function we use with gclient_utils has moved to gclient_paths. However, I am not sure gclient_utils is used by others or not. Additional change: - sorted testMembersChanged members for ease of understanding what is different. Bug: 939959 Change-Id: I8b822e26afc73b39d2a33c5e07779c9c14cbd394 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1521850 Commit-Queue: Yoshisato Yanagisawa Reviewed-by: Nico Weber Reviewed-by: Dirk Pranke Reviewed-by: Fumitoshi Ukai --- presubmit_support.py | 5 +++-- tests/presubmit_unittest.py | 33 +++++++++++++++------------------ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/presubmit_support.py b/presubmit_support.py index fdbbc7207..987b4c3aa 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -44,7 +44,8 @@ from warnings import warn # Local imports. import fix_encoding -import gclient_utils # Exposed through the API +import gclient_paths # Exposed through the API +import gclient_utils import git_footers import gerrit_util import owners @@ -516,7 +517,7 @@ class InputApi(object): self.cpplint = cpplint self.cStringIO = cStringIO self.fnmatch = fnmatch - self.gclient_utils = gclient_utils + self.gclient_paths = gclient_paths self.glob = glob.glob self.json = json self.logging = logging.getLogger('PRESUBMIT') diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index a60484107..de5a04fbd 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -173,23 +173,20 @@ class PresubmitUnittest(PresubmitTestsBase): def testMembersChanged(self): self.mox.ReplayAll() members = [ - 'AffectedFile', 'Change', 'DoPostUploadExecuter', 'DoPresubmitChecks', - 'GetPostUploadExecuter', 'GitAffectedFile', 'CommandData', - 'GitChange', 'InputApi', 'ListRelevantPresubmitFiles', 'main', - 'OutputApi', 'ParseFiles', - 'PresubmitFailure', 'PresubmitExecuter', 'PresubmitOutput', 'ScanSubDirs', - 'SigintHandler', 'ThreadPool', - 'ast', 'cPickle', 'cpplint', 'cStringIO', 'contextlib', - 'canned_check_filter', 'fix_encoding', 'fnmatch', 'gclient_utils', - 'git_footers', 'glob', 'inspect', 'json', 'load_files', 'logging', - 'marshal', 'normpath', 'optparse', 'os', 'owners', 'owners_finder', - 'pickle', 'presubmit_canned_checks', 'random', 're', 'scm', - 'sigint_handler', 'signal', - 'subprocess', 'sys', 'tempfile', 'threading', - 'time', 'traceback', 'types', 'unittest', - 'urllib2', 'warn', 'multiprocessing', 'DoGetTryMasters', - 'GetTryMastersExecuter', 'itertools', 'urlparse', 'gerrit_util', - 'GerritAccessor', + 'AffectedFile', 'Change', 'CommandData', 'DoGetTryMasters', + 'DoPostUploadExecuter', 'DoPresubmitChecks', 'GerritAccessor', + 'GetPostUploadExecuter', 'GetTryMastersExecuter', 'GitAffectedFile', + 'GitChange', 'InputApi', 'ListRelevantPresubmitFiles', 'OutputApi', + 'ParseFiles', 'PresubmitExecuter', 'PresubmitFailure', + 'PresubmitOutput', 'ScanSubDirs', 'SigintHandler', 'ThreadPool', 'ast', + 'cPickle', 'cStringIO', 'canned_check_filter', 'contextlib', 'cpplint', + 'fix_encoding', 'fnmatch', 'gclient_paths', 'gclient_utils', + 'gerrit_util', 'git_footers', 'glob', 'inspect', 'itertools', 'json', + 'load_files', 'logging', 'main', 'marshal', 'multiprocessing', + 'normpath', 'optparse', 'os', 'owners', 'owners_finder', 'pickle', + 'presubmit_canned_checks', 'random', 're', 'scm', 'sigint_handler', + 'signal', 'subprocess', 'sys', 'tempfile', 'threading', 'time', + 'traceback', 'types', 'unittest', 'urllib2', 'urlparse', 'warn' ] # If this test fails, you should add the relevant test. self.compareMembers(presubmit, members) @@ -957,7 +954,7 @@ class InputApiUnittest(PresubmitTestsBase): 'dry_run', 'environ', 'fnmatch', - 'gclient_utils', + 'gclient_paths', 'gerrit', 'glob', 'is_committing',