Commit 953586a1 authored by maruel@chromium.org's avatar maruel@chromium.org

Make scm.py work around even more with bad interaction better svn client and google code.

The novel addition here is to not convert a checkout into an update when no
files were checked out. Also delete the directory to increase the chances of
success.

TEST=wait for google code to fail again
BUG=32783

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@49788 0039d316-1c4b-4281-b951-d872f2087c98
parent 54a07a2f
......@@ -446,17 +446,46 @@ class SVN(object):
True,
CaptureMatchingLines)
except gclient_utils.Error:
# We enforce that some progress has been made or HTTP 502.
if (filter(lambda x: '502 Bad Gateway' in x, failure) or
(len(failure) and len(file_list) > previous_list_len)):
if args[0] == 'checkout':
# An aborted checkout is now an update.
# Subversion client is really misbehaving with Google Code.
if args[0] == 'checkout':
# Ensure at least one file was checked out, otherwise *delete* the
# directory.
if len(file_list) == previous_list_len:
for x in failure:
if ('502 Bad Gateway' in x or
'svn: REPORT of \'/svn/!svn/vcc/default\': 200 OK' in x):
# No file were checked out, so make sure the directory is
# deleted in case it's messed up and try again.
# Warning: It's bad, it assumes args[2] is the directory
# argument.
if os.path.isdir(args[2]):
chromium_utils.RemoveDirectory(args[2])
break
else:
# No known svn error was found, bail out.
raise
else:
# Progress was made, convert to update since an aborted checkout
# is now an update.
args = ['update'] + args[1:]
print "Sleeping 15 seconds and retrying...."
time.sleep(15)
continue
# No progress was made or an unknown error we aren't sure, bail out.
raise
else:
# It was an update or export.
# We enforce that some progress has been made or HTTP 502.
if len(file_list) == previous_list_len:
for x in failure:
if ('502 Bad Gateway' in x or
'svn: REPORT of \'/svn/!svn/vcc/default\': 200 OK' in x):
# Ok, know failure code.
break
else:
# No known svn error was found, bail out.
raise
else:
# Progress was made, it's fine.
pass
print "Sleeping 15 seconds and retrying...."
time.sleep(15)
continue
break
@staticmethod
......
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