From 336643a14be9ab863d6cbb38a0837e231a89314c Mon Sep 17 00:00:00 2001 From: Stephanie Kim Date: Wed, 17 Apr 2024 16:20:34 +0000 Subject: [PATCH] Don't clear directory for new/removed entries This was from back when we were clearing the whole directory instead of just the extracted contents Bug: b/324418194 Change-Id: I496b0faed2023a8fa3b4ea772a7744f2acc9be6a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5459298 Reviewed-by: Joanna Wang Commit-Queue: Stephanie Kim --- gclient_scm.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/gclient_scm.py b/gclient_scm.py index ce39d27750..f1b62f7f0f 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -1987,17 +1987,9 @@ class GcsRoot(object): # If any GCS deps are added or removed entirely, clobber that path intersected_paths = parsed_paths.intersection(resolved_paths) - # Added paths - for path in parsed_paths - intersected_paths: - full_path = os.path.join(self.root_dir, path) - gclient_utils.rmtree(full_path) - # Removed paths - for path in resolved_paths - intersected_paths: - full_path = os.path.join(self.root_dir, path) - gclient_utils.rmtree(full_path) - # If any objects within a GCS dep are added/removed, clobber that - # entire path + # If any objects within a GCS dep are added/removed, clobber its + # extracted contents and relevant gcs dotfiles for path in intersected_paths: resolved_objects = resolved_object_dict[path] parsed_objects = parsed_object_dict[path]