From adfd994f983aa9cb9906816aaabf538ca6a7f547 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Tue, 14 May 2024 20:29:50 +0000 Subject: [PATCH] [gclient] remove output_file from gcs object setdep We now ask users to preserve the order of objects since there are now two fields that don't need to updated (output_file and condition). R=kimstephanie@google.com Change-Id: Ic2e8c0b350060247458e733f14466145c2af435f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5539331 Commit-Queue: Josip Sokcevic Auto-Submit: Josip Sokcevic Reviewed-by: Stephanie Kim --- gclient.py | 14 +++++--------- gclient_eval.py | 3 +-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/gclient.py b/gclient.py index c9178b254..b43f1207d 100755 --- a/gclient.py +++ b/gclient.py @@ -4185,7 +4185,7 @@ def CMDsetdep(parser, args): 'object_name2,sha256sum2,size_bytes2,generation2?... ' 'The number of revision objects for a given path must ' 'match the current number of revision objects for that ' - 'path.') + 'path, and objects order will be preserved.') parser.add_option( '--deps-file', default='DEPS', @@ -4269,20 +4269,16 @@ def CMDsetdep(parser, args): raw_objects = value.split('?') for o in raw_objects: object_info = o.split(',') - if len(object_info) != 4 and len(object_info) != 5: + if len(object_info) != 4: parser.error( 'All values are required in the revision object: ' - 'object_name, sha256sum, size_bytes, generation, ' - 'and (optional) output_file.') - object_dict = { + 'object_name, sha256sum, size_bytes and generation.') + objects.append({ 'object_name': object_info[0], 'sha256sum': object_info[1], 'size_bytes': object_info[2], 'generation': object_info[3], - } - if len(object_info) == 5: - object_dict['output_file'] = object_info[4] - objects.append(object_dict) + }) gclient_eval.SetGCS(local_scope, name, objects) else: # git dependencies # Update DEPS only when `git_dependencies` == DEPS or SYNC. diff --git a/gclient_eval.py b/gclient_eval.py index 6541c4170..32adb9caa 100644 --- a/gclient_eval.py +++ b/gclient_eval.py @@ -813,8 +813,7 @@ def SetGCS(gclient_dict, dep_name, new_objects): "number of objects.") # Allow only `keys_to_update` to be updated. - keys_to_update = ('object_name', 'sha256sum', 'size_bytes', 'generation', - 'output_file') + keys_to_update = ('object_name', 'sha256sum', 'size_bytes', 'generation') for index, object_node in enumerate(objects_node.elts): for key, value in zip(object_node.keys, object_node.values): if key.s not in keys_to_update: