@ -353,27 +353,28 @@ class GitWrapper(SCMWrapper):
else :
else :
raise gclient_utils . Error ( ' Invalid Upstream: %s ' % upstream_branch )
raise gclient_utils . Error ( ' Invalid Upstream: %s ' % upstream_branch )
# Update the remotes first so we have all the refs.
if not scm . GIT . IsValidRevision ( cwd = self . checkout_path , rev = revision ) :
backoff_time = 5
# Update the remotes first so we have all the refs.
for _ in range ( 10 ) :
backoff_time = 5
try :
for _ in range ( 10 ) :
remote_output = scm . GIT . Capture (
try :
[ ' remote ' ] + verbose + [ ' update ' ] ,
remote_output = scm . GIT . Capture (
cwd = self . checkout_path )
[ ' remote ' ] + verbose + [ ' update ' ] ,
break
cwd = self . checkout_path )
except subprocess2 . CalledProcessError , e :
break
# Hackish but at that point, git is known to work so just checking for
except subprocess2 . CalledProcessError , e :
# 502 in stderr should be fine.
# Hackish but at that point, git is known to work so just checking for
if ' 502 ' in e . stderr :
# 502 in stderr should be fine.
print ( str ( e ) )
if ' 502 ' in e . stderr :
print ( ' Sleeping %.1f seconds and retrying... ' % backoff_time )
print ( str ( e ) )
time . sleep ( backoff_time )
print ( ' Sleeping %.1f seconds and retrying... ' % backoff_time )
backoff_time * = 1.3
time . sleep ( backoff_time )
continue
backoff_time * = 1.3
raise
continue
raise
if verbose :
if verbose :
print ( remote_output . strip ( ) )
print ( remote_output . strip ( ) )
# This is a big hammer, debatable if it should even be here...
# This is a big hammer, debatable if it should even be here...
if options . force or options . reset :
if options . force or options . reset :