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

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 101811)
+++ gclient_scm.py (working copy)
@@ -766,7 +766,18 @@
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)
+ try:
+ self._Run(['cleanup', d[1]], options)
+ except subprocess2.CalledProcessError, e:
+ # Only remove the directory automatically if it's not versioned
+ # and --force is used.
+ if d[0][0] in ('?', '!') and options.force:
M-A Ruel 2011/09/19 20:36:25 I don't see why you'd get the status '? L '. I
Paweł Hajdan Jr. 2011/09/19 20:40:06 I was getting '! L '.
M-A Ruel 2011/09/19 20:43:59 In that case, it's because the root directory is n
+ print 'Removing troublesome path %s' % d[1]
+ gclient_utils.rmtree(d[1])
+ else:
+ print 'Not removing troublesome path %s automatically.' % d[1]
+ print 'If the directory is not versioned you can use --force.'
+ raise e
# Retrieve the current HEAD version because svn is slow at null updates.
if options.manually_grab_svn_rev and not revision:
« 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