Parcourir la source

Revert "[bot_update] Also bootstrap in the case that there are 0 pack files"

This reverts commit 32a801b5dadfd40ef7999339559413408555ebdc.

Reason for revert:
It's causing depot tools presubmit to time out
(Also, introduces a Python 3 error for git_cache).

Original change's description:
> [bot_update] Also bootstrap in the case that there are 0 pack files
> 
> This can happen if the cache repo was init'd, but has no pack files;
> previously it would try to fetch from scratch.
> 
> R=​ehmaldonado@chromium.org, tandrii@chromium.org
> 
> No-Presubmit: true
> Change-Id: I97e863dd6c2ecfd00fdb4238dda48e0d3929c4f2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1941337
> Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>

TBR=iannucci@chromium.org,tandrii@google.com,ehmaldonado@chromium.org

Change-Id: I93366bcc6ff1df579a67d51c2cda812c84a06215
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1951985
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Edward Lesmes il y a 5 ans
Parent
commit
cc11b065c5
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      git_cache.py

+ 1 - 2
git_cache.py

@@ -486,12 +486,11 @@ class Mirror(object):
     pack_files = []
     pack_files = []
     if os.path.isdir(pack_dir):
     if os.path.isdir(pack_dir):
       pack_files = [f for f in os.listdir(pack_dir) if f.endswith('.pack')]
       pack_files = [f for f in os.listdir(pack_dir) if f.endswith('.pack')]
-      self.print('%s has %d .pack files, re-bootstrapping if ==0 or >%d' %
+      self.print('%s has %d .pack files, re-bootstrapping if >%d' %
                 (self.mirror_path, len(pack_files), GC_AUTOPACKLIMIT))
                 (self.mirror_path, len(pack_files), GC_AUTOPACKLIMIT))
 
 
     should_bootstrap = (force or
     should_bootstrap = (force or
                         not self.exists() or
                         not self.exists() or
-                        len(pack_files) == 0 or
                         len(pack_files) > GC_AUTOPACKLIMIT)
                         len(pack_files) > GC_AUTOPACKLIMIT)
 
 
     if not should_bootstrap:
     if not should_bootstrap: