Add automatic retry on HTTP 502 for svn and connection drop for git.
TEST=totally untested
BUG=34793
Review URL: http://codereview.chromium.org/574017
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@38336 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/scm.py b/scm.py
index df22271..48118d1 100644
--- a/scm.py
+++ b/scm.py
@@ -380,14 +380,14 @@
True,
CaptureMatchingLines)
except gclient_utils.Error:
- # We enforce that some progress has been made.
- if len(failure) and len(file_list) > previous_list_len:
+ # We enforce that some progress has been made or HTTP 502.
+ if ([True for f in failure if '502 Bad Gateway' in f] or
+ (len(failure) and len(file_list) > previous_list_len)):
if args[0] == 'checkout':
- args = args[:]
# An aborted checkout is now an update.
- args[0] = 'update'
+ args = ['update'] + args[1:]
continue
- # No progress was made, bail out.
+ # No progress was made or an unknown error we aren't sure, bail out.
raise
break