Commit 260ab401 authored by Dan Jacques's avatar Dan Jacques Committed by Commit Bot

Remote nested retries on checkout.

Remove nested retries on checkout. Since the outer loop handles retries
specially, we want to let it exclusively handle retries. This will
prevent the inner retry loop triggering a timeout condition (rather than
a failure condition) with the outer loop.

BUG=chromium:665116
TEST=None

Change-Id: I4bf0c08b75861bf1c95060452118c314a121f9f3
Reviewed-on: https://chromium-review.googlesource.com/411397Reviewed-by: 's avatarRyan Tseng <hinoka@chromium.org>
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
parent a98a6cd4
...@@ -470,10 +470,10 @@ def force_revision(folder_name, revision): ...@@ -470,10 +470,10 @@ def force_revision(folder_name, revision):
branch, revision = split_revision branch, revision = split_revision
if revision and revision.upper() != 'HEAD': if revision and revision.upper() != 'HEAD':
git('checkout', '--force', revision, cwd=folder_name) git('checkout', '--force', revision, cwd=folder_name, tries=1)
else: else:
ref = branch if branch.startswith('refs/') else 'origin/%s' % branch ref = branch if branch.startswith('refs/') else 'origin/%s' % branch
git('checkout', '--force', ref, cwd=folder_name) git('checkout', '--force', ref, cwd=folder_name, tries=1)
def is_broken_repo_dir(repo_dir): def is_broken_repo_dir(repo_dir):
...@@ -544,14 +544,15 @@ def git_checkout(solutions, revisions, shallow, refs, git_cache_dir): ...@@ -544,14 +544,15 @@ def git_checkout(solutions, revisions, shallow, refs, git_cache_dir):
print 'Git repo %s appears to be broken, removing it' % sln_dir print 'Git repo %s appears to be broken, removing it' % sln_dir
remove(sln_dir) remove(sln_dir)
# Use "tries=1", since we retry manually in this loop.
if not path.isdir(sln_dir): if not path.isdir(sln_dir):
git(*clone_cmd) git(*clone_cmd, tries=1)
else: else:
git('remote', 'set-url', 'origin', mirror_dir, cwd=sln_dir) git('remote', 'set-url', 'origin', mirror_dir, cwd=sln_dir, tries=1)
git('fetch', 'origin', cwd=sln_dir) git('fetch', 'origin', cwd=sln_dir, tries=1)
for ref in refs: for ref in refs:
refspec = '%s:%s' % (ref, ref.lstrip('+')) refspec = '%s:%s' % (ref, ref.lstrip('+'))
git('fetch', 'origin', refspec, cwd=sln_dir) git('fetch', 'origin', refspec, cwd=sln_dir, tries=1)
# Windows sometimes has trouble deleting files. # Windows sometimes has trouble deleting files.
# This can make git commands that rely on locks fail. # This can make git commands that rely on locks fail.
......
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