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

Unified Diff: git_cache.py

Issue 538993002: Make git cache delete a defunct directory instead of moving it (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: lint Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cache.py
diff --git a/git_cache.py b/git_cache.py
index 21252535f491146eea20efa32179144b8d469827..5d1af238ede978de79aeef8a8df52999a46e9e05 100755
--- a/git_cache.py
+++ b/git_cache.py
@@ -14,7 +14,6 @@ import re
import tempfile
import threading
import time
-import shutil
import subprocess
import sys
import urlparse
@@ -344,14 +343,7 @@ class Mirror(object):
bootstrapped = not depth and bootstrap and self.bootstrap_repo(tempdir)
if bootstrapped:
# Bootstrap succeeded; delete previous cache, if any.
- try:
- # Try to move folder to tempdir if possible.
- defunct_dir = tempfile.mkdtemp()
- shutil.move(self.mirror_path, defunct_dir)
- self.print('Moved defunct directory for repository %s from %s to %s'
- % (self.url, self.mirror_path, defunct_dir))
- except Exception:
- gclient_utils.rmtree(self.mirror_path)
+ gclient_utils.rmtree(self.mirror_path)
elif not os.path.exists(config_file):
# Bootstrap failed, no previous cache; start with a bare git dir.
self.RunGit(['init', '--bare'], cwd=tempdir)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698