Index: gclient_scm.py |
=================================================================== |
--- gclient_scm.py (revision 101994) |
+++ gclient_scm.py (working copy) |
@@ -764,9 +764,21 @@ |
# 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) |
+ needs_cleanup = any(d[0][2] == 'L' for d in dir_info) |
+ if needs_cleanup: |
M-A Ruel
2011/09/20 20:55:33
if any(d[0][2] == 'L' for d in dir_info):
|
+ try: |
+ self._Run(['cleanup', self.checkout_path], options) |
+ except subprocess2.CalledProcessError, e: |
+ for d in dir_info: |
M-A Ruel
2011/09/20 20:55:33
Add comment:
# Try to manually clean up each indiv
|
+ 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: |