Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Unified Diff: git_cl.py

Issue 213573004: Process first branch status request before spawning threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: CHanged branches to a list. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 1a1c64847f26c098dd292278249108de56e42980..fefb9b72ee5344072dfb725bb28f26d98f74e061 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1209,7 +1209,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.
@@ -1255,7 +1255,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()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698