##// END OF EJS Templates
discovery: use set instead of dict
Benoit Boissinot -
r12761:11c3c77d default
parent child Browse files
Show More
@@ -34,13 +34,13 b' def findcommonincoming(repo, remote, hea'
34 34 fetch = set()
35 35 seen = set()
36 36 seenbranch = set()
37 base = {}
37 base = set()
38 38
39 39 if not heads:
40 40 heads = remote.heads()
41 41
42 42 if repo.changelog.tip() == nullid:
43 base[nullid] = 1
43 base.add(nullid)
44 44 if heads != [nullid]:
45 45 return [nullid], [nullid], list(heads)
46 46 return [nullid], [], []
@@ -54,11 +54,11 b' def findcommonincoming(repo, remote, hea'
54 54 if h not in m:
55 55 unknown.append(h)
56 56 else:
57 base[h] = 1
57 base.add(h)
58 58
59 59 heads = unknown
60 60 if not unknown:
61 return base.keys(), [], []
61 return list(base), [], []
62 62
63 63 req = set(unknown)
64 64 reqcnt = 0
@@ -95,7 +95,7 b' def findcommonincoming(repo, remote, hea'
95 95 fetch.add(n[1]) # earliest unknown
96 96 for p in n[2:4]:
97 97 if p in m:
98 base[p] = 1 # latest known
98 base.add(p) # latest known
99 99
100 100 for p in n[2:4]:
101 101 if p not in req and p not in m:
@@ -130,7 +130,7 b' def findcommonincoming(repo, remote, hea'
130 130 repo.ui.debug("found new branch changeset %s\n" %
131 131 short(p))
132 132 fetch.add(p)
133 base[i] = 1
133 base.add(i)
134 134 else:
135 135 repo.ui.debug("narrowed branch search to %s:%s\n"
136 136 % (short(p), short(i)))
@@ -145,7 +145,8 b' def findcommonincoming(repo, remote, hea'
145 145 raise error.RepoError(_("already have changeset ")
146 146 + short(f[:4]))
147 147
148 if base.keys() == [nullid]:
148 base = list(base)
149 if base == [nullid]:
149 150 if force:
150 151 repo.ui.warn(_("warning: repository is unrelated\n"))
151 152 else:
@@ -157,7 +158,7 b' def findcommonincoming(repo, remote, hea'
157 158 repo.ui.progress(_('searching'), None)
158 159 repo.ui.debug("%d total queries\n" % reqcnt)
159 160
160 return base.keys(), list(fetch), heads
161 return base, list(fetch), heads
161 162
162 163 def findoutgoing(repo, remote, base=None, remoteheads=None, force=False):
163 164 """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