]> Cypherpunks repositories - gostls13.git/commitdiff
fix authentication in parallel LoadAllCL
authorRuss Cox <rsc@golang.org>
Sun, 8 Nov 2009 02:56:29 +0000 (18:56 -0800)
committerRuss Cox <rsc@golang.org>
Sun, 8 Nov 2009 02:56:29 +0000 (18:56 -0800)
R=r
http://go/go-review/1024018

lib/codereview/codereview.py

index 06423963bb7eee2342a02f4f221b73277997aacb..f5ebc595e85330821c807985cfc2ebbf4f6de7d6 100644 (file)
@@ -372,14 +372,21 @@ def LoadAllCL(ui, repo, web=True):
        files = [f for f in os.listdir(dir) if f.startswith('cl.')]
        if not files:
                return m
-       if web:
-               # Authenticate now, so we can use threads below
-               MySend(None)
        active = []
+       first = True
        for f in files:
                t = LoadCLThread(ui, repo, dir, f, web)
                t.start()
-               active.append(t)
+               if web and first:
+                       # first request: wait in case it needs to authenticate
+                       # otherwise we get lots of user/password prompts
+                       # running in parallel.
+                       t.join()
+                       if t.cl:
+                               m[t.cl.name] = t.cl
+                       first = False
+               else:
+                       active.append(t)
        for t in active:
                t.join()
                if t.cl: