mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Set rootRepo custom-keyed-value push option on upload
This associates a CL with its superproject. Bug: 401148931 Change-Id: I7fe7bd91485e6e1066963b25f1b95980db6d3381 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6476918 Reviewed-by: Josip Sokcevic <sokcevic@chromium.org> Commit-Queue: Gavin Mak <gavinmak@google.com>
This commit is contained in:
@@ -156,13 +156,25 @@ def GetExeSuffix():
|
||||
|
||||
|
||||
@functools.lru_cache
|
||||
def GetGClientPrimarySolutionName(gclient_root_dir_path):
|
||||
"""Returns the name of the primary solution in the .gclient file specified."""
|
||||
def _GetGClientSolutions(gclient_root_dir_path):
|
||||
gclient_config_file = os.path.join(gclient_root_dir_path, '.gclient')
|
||||
gclient_config_contents = gclient_utils.FileRead(gclient_config_file)
|
||||
env = {}
|
||||
exec(gclient_config_contents, env)
|
||||
solutions = env.get('solutions', [])
|
||||
return env.get('solutions', [])
|
||||
|
||||
|
||||
def GetGClientPrimarySolutionName(gclient_root_dir_path):
|
||||
"""Returns the name of the primary solution in the .gclient file specified."""
|
||||
solutions = _GetGClientSolutions(gclient_root_dir_path)
|
||||
if solutions:
|
||||
return solutions[0].get('name')
|
||||
return None
|
||||
|
||||
|
||||
def GetGClientPrimarySolutionURL(gclient_root_dir_path):
|
||||
"""Returns the URL of the primary solution in the .gclient file specified."""
|
||||
solutions = _GetGClientSolutions(gclient_root_dir_path)
|
||||
if solutions:
|
||||
return solutions[0].get('url')
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user