Browse Source

Only sync non_git_sources for IsEnvCog().

Bug: 345321320
Change-Id: I8aca8dca298dd147fa6b88b43632a51852669ea5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5598577
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Joanna Wang 1 year ago
parent
commit
1545a081d8
1 changed files with 10 additions and 0 deletions
  1. 10 0
      gclient.py

+ 10 - 0
gclient.py

@@ -778,6 +778,10 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
                 continue
 
             if dep_type == 'cipd':
+                # TODO(b/345321320): Remove when non_git_sources are properly supported.
+                if gclient_utils.IsEnvCog() and (
+                        not condition or "non_git_source" not in condition):
+                    continue
                 cipd_root = self.GetCipdRoot()
                 for package in dep_value.get('packages', []):
                     deps_to_add.append(
@@ -807,6 +811,12 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
                 for obj in dep_value['objects']:
                     merged_condition = gclient_utils.merge_conditions(
                         condition, obj.get('condition'))
+                    # TODO(b/345321320): Remove when non_git_sources are properly supported.
+                    if gclient_utils.IsEnvCog() and (not merged_condition
+                                                     or "non_git_source"
+                                                     not in merged_condition):
+                        continue
+
                     should_process_object = should_process and _should_process(
                         merged_condition)