##// END OF EJS Templates
findincoming: do the binary search in branches in parallel
Benoit Boissinot -
r7208:acb87c5b default
parent child Browse files
Show More
@@ -1343,27 +1343,29 b' class localrepository(repo.repository):'
1343 unknown.append(b)
1343 unknown.append(b)
1344
1344
1345 # do binary search on the branches we found
1345 # do binary search on the branches we found
1346 search = [(t, b) for (t, b, p1, p2) in search]
1346 while search:
1347 while search:
1347 n = search.pop(0)
1348 newsearch = []
1348 reqcnt += 1
1349 reqcnt += 1
1349 l = remote.between([(n[0], n[1])])[0]
1350 for n, l in zip(search, remote.between(search)):
1350 l.append(n[1])
1351 l.append(n[1])
1351 p = n[0]
1352 p = n[0]
1352 f = 1
1353 f = 1
1353 for i in l:
1354 for i in l:
1354 self.ui.debug(_("narrowing %d:%d %s\n") % (f, len(l), short(i)))
1355 self.ui.debug(_("narrowing %d:%d %s\n") % (f, len(l), short(i)))
1355 if i in m:
1356 if i in m:
1356 if f <= 2:
1357 if f <= 2:
1357 self.ui.debug(_("found new branch changeset %s\n") %
1358 self.ui.debug(_("found new branch changeset %s\n") %
1358 short(p))
1359 short(p))
1359 fetch[p] = 1
1360 fetch[p] = 1
1360 base[i] = 1
1361 base[i] = 1
1361 else:
1362 else:
1362 self.ui.debug(_("narrowed branch search to %s:%s\n")
1363 self.ui.debug(_("narrowed branch search to %s:%s\n")
1363 % (short(p), short(i)))
1364 % (short(p), short(i)))
1364 search.append((p, i))
1365 newsearch.append((p, i))
1365 break
1366 break
1366 p, f = i, f * 2
1367 p, f = i, f * 2
1368 search = newsearch
1367
1369
1368 # sanity check our fetch list
1370 # sanity check our fetch list
1369 for f in fetch.keys():
1371 for f in fetch.keys():
General Comments 0
You need to be logged in to leave comments. Login now