From a4c03054cbdc251d6e8e4cadeea72bf7bb0ac934 Mon Sep 17 00:00:00 2001 From: "jrobbins@chromium.org" Date: Fri, 25 Apr 2014 19:06:36 +0000 Subject: [PATCH] Process first branch status request before spawning threads. BUG=341052 Review URL: https://codereview.chromium.org/213573004 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@266219 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git_cl.py b/git_cl.py index f2f3434e3..1acc12a69 100755 --- a/git_cl.py +++ b/git_cl.py @@ -1211,7 +1211,7 @@ def CMDstatus(parser, args): return 0 changes = (Changelist(branchref=b) for b in branches.splitlines()) - branches = dict((c.GetBranch(), c.GetIssueURL()) for c in changes) + branches = [c.GetBranch() for c in changes] alignment = max(5, max(len(b) for b in branches)) print 'Branches associated with reviews:' # Adhoc thread pool to request data concurrently. @@ -1257,7 +1257,12 @@ def CMDstatus(parser, args): color = Fore.BLUE output.put((b, i, color)) - threads = [threading.Thread(target=fetch, args=(b,)) for b in branches] + # Process one branch synchronously to work through authentication, then + # spawn threads to process all the other branches in parallel. + if branches: + fetch(branches[0]) + threads = [ + threading.Thread(target=fetch, args=(b,)) for b in branches[1:]] for t in threads: t.daemon = True t.start()