return error if gclient setdep is called for git dep in Cog

Bug: 339231299
Change-Id: I2ec445412d2d5796cccedac9a548de1a45072a07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5529884
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
changes/84/5529884/4
Yiwei Zhang 12 months ago committed by LUCI CQ
parent 6e32e926e9
commit e5cacc3a8a

@ -4197,8 +4197,10 @@ def CMDsetdep(parser, args):
# Create a set of all git submodules.
cwd = os.path.dirname(options.deps_file) or os.getcwd()
git_modules = None
if 'git_dependencies' in local_scope and local_scope[
'git_dependencies'] in (gclient_eval.SUBMODULES, gclient_eval.SYNC):
is_cog = gclient_utils.IsEnvCog()
if (not is_cog and 'git_dependencies' in local_scope
and local_scope['git_dependencies']
in (gclient_eval.SUBMODULES, gclient_eval.SYNC)):
try:
submodule_status = subprocess2.check_output(
['git', 'submodule', 'status'], cwd=cwd).decode('utf-8')
@ -4248,7 +4250,7 @@ def CMDsetdep(parser, args):
object_dict['output_file'] = object_info[4]
objects.append(object_dict)
gclient_eval.SetGCS(local_scope, name, objects)
else:
else: # git dependencies
# Update DEPS only when `git_dependencies` == DEPS or SYNC.
# git_dependencies is defaulted to DEPS when not set.
if 'git_dependencies' not in local_scope or local_scope[
@ -4261,6 +4263,10 @@ def CMDsetdep(parser, args):
if git_modules and 'git_dependencies' in local_scope and local_scope[
'git_dependencies'] in (gclient_eval.SUBMODULES,
gclient_eval.SYNC):
if is_cog:
parser.error(
f'Set git dependency "{name}" is currently not '
'supported.')
git_module_name = name
if not 'use_relative_paths' in local_scope or \
local_scope['use_relative_paths'] != True:

Loading…
Cancel
Save