Commit 62087574 authored by maruel@chromium.org's avatar maruel@chromium.org

Fix an error in gclient revert where a directory is unexpected and locked

This would spurious try job failures because the gclient revert step would throw
an exception.

R=cmp@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/10169034

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@133799 0039d316-1c4b-4281-b951-d872f2087c98
parent 90d63888
......@@ -1024,6 +1024,11 @@ class SVN(object):
logging.info('Ignoring external %s' % file_status[1])
continue
# This is the case where '! L .' is returned by 'svn status'. Just
# strip off the '/.'.
if file_path.endswith(os.path.sep + '.'):
file_path = file_path[:-2]
if callback:
callback(file_status)
......
......@@ -290,7 +290,8 @@ class SVNWrapperTestCase(BaseTestCase):
('~ ', '.'),
]
gclient_scm.scm.SVN.CaptureStatus(None, self.base_path).AndReturn(items)
file_path = join(self.base_path, '.')
# RemoveDirectory() doesn't work on path ending with '.', like 'foo/.'.
file_path = self.base_path
gclient_scm.os.path.exists(file_path).AndReturn(True)
gclient_scm.os.path.isfile(file_path).AndReturn(False)
gclient_scm.os.path.islink(file_path).AndReturn(False)
......@@ -305,7 +306,7 @@ class SVNWrapperTestCase(BaseTestCase):
relpath=self.relpath)
file_list2 = []
scm.revert(options, self.args, file_list2)
self.checkstdout(('%s\n' % file_path))
self.checkstdout(('%s\n' % os.path.join(file_path, '.')))
def testStatus(self):
options = self.Options(verbose=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment