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:
Gavin Mak
2025-04-29 09:30:41 -07:00
committed by LUCI CQ
parent 43d3eba89b
commit 4edb194e91
2 changed files with 48 additions and 5 deletions

View File

@@ -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