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

Unified Diff: gclient_scm.py

Issue 7942007: GTTF: Make gclient recover gracefully from an interrupted checkout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 9 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: gclient_scm.py
===================================================================
--- gclient_scm.py (revision 102020)
+++ gclient_scm.py (working copy)
@@ -781,10 +781,26 @@
# Look for locked directories.
dir_info = scm.SVN.CaptureStatus(os.path.join(self.checkout_path, '.'))
- for d in dir_info:
- if d[0][2] == 'L':
- self._Run(['cleanup', d[1]], options)
+ if any(d[0][2] == 'L' for d in dir_info):
+ try:
+ self._Run(['cleanup', self.checkout_path], options)
+ except subprocess2.CalledProcessError, e:
+ # Get the status again, svn cleanup may have cleaned up at least
+ # something.
+ dir_info = scm.SVN.CaptureStatus(os.path.join(self.checkout_path, '.'))
+ # Try to fix the failures by removing troublesome files.
+ for d in dir_info:
+ if d[0][2] == 'L':
+ if d[0][0] == '!' and options.force:
+ print 'Removing troublesome path %s' % d[1]
+ gclient_utils.rmtree(d[1])
+ else:
+ print 'Not removing troublesome path %s automatically.' % d[1]
+ if d[0][0] == '!':
+ print 'You can pass --force to enable automatic removal.'
+ raise e
+
# Retrieve the current HEAD version because svn is slow at null updates.
if options.manually_grab_svn_rev and not revision:
from_info_live = scm.SVN.CaptureInfo(from_info['URL'])
« 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