 Chromium Code Reviews
 Chromium Code Reviews Issue 9348054:
  If --force is specified when updating, remove unversioned directories  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
    
  
    Issue 9348054:
  If --force is specified when updating, remove unversioned directories  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/| Index: gclient_scm.py | 
| =================================================================== | 
| --- gclient_scm.py (revision 121254) | 
| +++ gclient_scm.py (working copy) | 
| @@ -914,7 +914,7 @@ | 
| if not options.force and not options.reset: | 
| # Look for local modifications but ignore unversioned files. | 
| for status in scm.SVN.CaptureStatus(None, self.checkout_path): | 
| - if status[0] != '?': | 
| + if status[0][0] != '?': | 
| raise gclient_utils.Error( | 
| ('Can\'t switch the checkout to %s; UUID don\'t match and ' | 
| 'there is local changes in %s. Delete the directory and ' | 
| @@ -939,6 +939,18 @@ | 
| command = self._AddAdditionalUpdateFlags(command, options, revision) | 
| self._RunAndGetFileList(command, options, file_list, self._root_dir) | 
| + # If --force is specified, remove directories which have been removed from | 
| + # the repository but which may still exist in the working copy. | 
| + if options.force: | 
| 
M-A Ruel
2012/02/10 01:43:55
I'd prefer to start with:
if options.force and opt
 | 
| + # Note that we don't check to see if the directory is ignored, as when | 
| + # moving a directory from the main repository to deps/, we'd like to be | 
| + # able to set svn:ignore in the same change. | 
| + for status in scm.SVN.CaptureStatus(file_list, self.checkout_path, False): | 
| + path = os.path.join(self.checkout_path, status[1]) | 
| + if status[0][0] == '?' and os.path.isdir(path): | 
| + print('\n_____ removing unversioned directory %s' % status[1]) | 
| + gclient_utils.RemoveDirectory(path) | 
| + | 
| def updatesingle(self, options, args, file_list): | 
| filename = args.pop() | 
| if scm.SVN.AssertVersion("1.5")[0]: |