##// END OF EJS Templates
localrepo: use sets in findcommonincoming
Martin Geisler -
r8156:9fd0822c default
parent child Browse files
Show More
@@ -1305,9 +1305,9 b' class localrepository(repo.repository):'
1305 """
1305 """
1306 m = self.changelog.nodemap
1306 m = self.changelog.nodemap
1307 search = []
1307 search = []
1308 fetch = {}
1308 fetch = set()
1309 seen = {}
1309 seen = set()
1310 seenbranch = {}
1310 seenbranch = set()
1311 if base == None:
1311 if base == None:
1312 base = {}
1312 base = {}
1313
1313
@@ -1361,13 +1361,13 b' class localrepository(repo.repository):'
1361 self.ui.debug(_("found incomplete branch %s:%s\n")
1361 self.ui.debug(_("found incomplete branch %s:%s\n")
1362 % (short(n[0]), short(n[1])))
1362 % (short(n[0]), short(n[1])))
1363 search.append(n[0:2]) # schedule branch range for scanning
1363 search.append(n[0:2]) # schedule branch range for scanning
1364 seenbranch[n] = 1
1364 seenbranch.add(n)
1365 else:
1365 else:
1366 if n[1] not in seen and n[1] not in fetch:
1366 if n[1] not in seen and n[1] not in fetch:
1367 if n[2] in m and n[3] in m:
1367 if n[2] in m and n[3] in m:
1368 self.ui.debug(_("found new changeset %s\n") %
1368 self.ui.debug(_("found new changeset %s\n") %
1369 short(n[1]))
1369 short(n[1]))
1370 fetch[n[1]] = 1 # earliest unknown
1370 fetch.add(n[1]) # earliest unknown
1371 for p in n[2:4]:
1371 for p in n[2:4]:
1372 if p in m:
1372 if p in m:
1373 base[p] = 1 # latest known
1373 base[p] = 1 # latest known
@@ -1376,7 +1376,7 b' class localrepository(repo.repository):'
1376 if p not in req and p not in m:
1376 if p not in req and p not in m:
1377 r.append(p)
1377 r.append(p)
1378 req.add(p)
1378 req.add(p)
1379 seen[n[0]] = 1
1379 seen.add(n[0])
1380
1380
1381 if r:
1381 if r:
1382 reqcnt += 1
1382 reqcnt += 1
@@ -1402,7 +1402,7 b' class localrepository(repo.repository):'
1402 if f <= 2:
1402 if f <= 2:
1403 self.ui.debug(_("found new branch changeset %s\n") %
1403 self.ui.debug(_("found new branch changeset %s\n") %
1404 short(p))
1404 short(p))
1405 fetch[p] = 1
1405 fetch.add(p)
1406 base[i] = 1
1406 base[i] = 1
1407 else:
1407 else:
1408 self.ui.debug(_("narrowed branch search to %s:%s\n")
1408 self.ui.debug(_("narrowed branch search to %s:%s\n")
@@ -1413,7 +1413,7 b' class localrepository(repo.repository):'
1413 search = newsearch
1413 search = newsearch
1414
1414
1415 # sanity check our fetch list
1415 # sanity check our fetch list
1416 for f in fetch.keys():
1416 for f in fetch:
1417 if f in m:
1417 if f in m:
1418 raise error.RepoError(_("already have changeset ")
1418 raise error.RepoError(_("already have changeset ")
1419 + short(f[:4]))
1419 + short(f[:4]))
@@ -1429,7 +1429,7 b' class localrepository(repo.repository):'
1429
1429
1430 self.ui.debug(_("%d total queries\n") % reqcnt)
1430 self.ui.debug(_("%d total queries\n") % reqcnt)
1431
1431
1432 return base.keys(), fetch.keys(), heads
1432 return base.keys(), list(fetch), heads
1433
1433
1434 def findoutgoing(self, remote, base=None, heads=None, force=False):
1434 def findoutgoing(self, remote, base=None, heads=None, force=False):
1435 """Return list of nodes that are roots of subsets not in remote
1435 """Return list of nodes that are roots of subsets not in remote
General Comments 0
You need to be logged in to leave comments. Login now