Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: git_cache.py

Issue 343523002: Refactor cache-updating code to eliminate unnecessary fetches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: git_cache.py
diff --git a/git_cache.py b/git_cache.py
index 92332808fe0758d46cd4a8170667280a16051926..5dac806dedadafdc40b10950849e09fb4c5c62f1 100755
--- a/git_cache.py
+++ b/git_cache.py
@@ -318,6 +318,7 @@ class Mirror(object):
def populate(self, depth=None, shallow=False, bootstrap=False,
verbose=False):
+ assert self.GetCachePath()
if shallow and not depth:
depth = 10000
gclient_utils.safe_makedirs(self.GetCachePath())
@@ -428,6 +429,8 @@ class Mirror(object):
@classmethod
def UnlockAll(cls):
cachepath = cls.GetCachePath()
+ if not cachepath:
+ return
dirlist = os.listdir(cachepath)
repo_dirs = set([os.path.join(cachepath, path) for path in dirlist
if os.path.isdir(os.path.join(cachepath, path))])
« gclient_scm.py ('K') | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698