Jelajahi Sumber

[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 <sokcevic@chromium.org>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Stephanie Kim <kimstephanie@google.com>
Josip Sokcevic 1 tahun lalu
induk
melakukan
adfd994f98
2 mengubah file dengan 6 tambahan dan 11 penghapusan
  1. 5 9
      gclient.py
  2. 1 2
      gclient_eval.py

+ 5 - 9
gclient.py

@@ -4185,7 +4185,7 @@ def CMDsetdep(parser, args):
                       'object_name2,sha256sum2,size_bytes2,generation2?... '
                       'object_name2,sha256sum2,size_bytes2,generation2?... '
                       'The number of revision objects for a given path must '
                       'The number of revision objects for a given path must '
                       'match the current number of revision objects for that '
                       'match the current number of revision objects for that '
-                      'path.')
+                      'path, and objects order will be preserved.')
     parser.add_option(
     parser.add_option(
         '--deps-file',
         '--deps-file',
         default='DEPS',
         default='DEPS',
@@ -4269,20 +4269,16 @@ def CMDsetdep(parser, args):
             raw_objects = value.split('?')
             raw_objects = value.split('?')
             for o in raw_objects:
             for o in raw_objects:
                 object_info = o.split(',')
                 object_info = o.split(',')
-                if len(object_info) != 4 and len(object_info) != 5:
+                if len(object_info) != 4:
                     parser.error(
                     parser.error(
                         'All values are required in the revision object: '
                         '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],
                     'object_name': object_info[0],
                     'sha256sum': object_info[1],
                     'sha256sum': object_info[1],
                     'size_bytes': object_info[2],
                     'size_bytes': object_info[2],
                     'generation': object_info[3],
                     '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)
             gclient_eval.SetGCS(local_scope, name, objects)
         else:  # git dependencies
         else:  # git dependencies
             # Update DEPS only when `git_dependencies` == DEPS or SYNC.
             # Update DEPS only when `git_dependencies` == DEPS or SYNC.

+ 1 - 2
gclient_eval.py

@@ -813,8 +813,7 @@ def SetGCS(gclient_dict, dep_name, new_objects):
                          "number of objects.")
                          "number of objects.")
 
 
     # Allow only `keys_to_update` to be updated.
     # 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 index, object_node in enumerate(objects_node.elts):
         for key, value in zip(object_node.keys, object_node.values):
         for key, value in zip(object_node.keys, object_node.values):
             if key.s not in keys_to_update:
             if key.s not in keys_to_update: