Fix a specific failure when reverting embedded directories.
TEST=gclient revert doesn't throw an exception
BUG=none
Review URL: http://codereview.chromium.org/255083
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28059 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient_scm.py b/gclient_scm.py
index 553f8f9..592074e 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -370,9 +370,15 @@
except EnvironmentError:
logging.error('Failed to remove %s.' % file_path)
- # svn revert is so broken we don't even use it. Using
- # "svn up --revision BASE" achieve the same effect.
- RunSVNAndGetFileList(['update', '--revision', 'BASE'], path, file_list)
+ try:
+ # svn revert is so broken we don't even use it. Using
+ # "svn up --revision BASE" achieve the same effect.
+ RunSVNAndGetFileList(['update', '--revision', 'BASE'], path,
+ file_list)
+ except OSError, e:
+ # Maybe the directory disapeared meanwhile. We don't want it to throw an
+ # exception.
+ logging.error('Failed to update:\n%s' % str(e))
def runhooks(self, options, args, file_list):
self.status(options, args, file_list)