##// END OF EJS Templates
discovery: stop using nodemap for membership testing...
Pierre-Yves David -
r20225:d2704c48 default
parent child Browse files
Show More
@@ -34,9 +34,9 b' def findcommonincoming(repo, remote, hea'
34 34
35 35 if heads:
36 36 allknown = True
37 nm = repo.changelog.nodemap
37 knownnode = repo.changelog.hasnode # no nodemap until it is filtered
38 38 for h in heads:
39 if nm.get(h) is None:
39 if not knownnode(h):
40 40 allknown = False
41 41 break
42 42 if allknown:
@@ -172,8 +172,9 b' def _headssummary(repo, remote, outgoing'
172 172 remotebranches.add(branch)
173 173 known = []
174 174 unsynced = []
175 knownnode = cl.hasnode # do not use nodemap until it is filtered
175 176 for h in heads:
176 if h in cl.nodemap:
177 if knownnode(h):
177 178 known.append(h)
178 179 else:
179 180 unsynced.append(h)
@@ -204,11 +205,11 b' def _headssummary(repo, remote, outgoing'
204 205 def _oldheadssummary(repo, remoteheads, outgoing, inc=False):
205 206 """Compute branchmapsummary for repo without branchmap support"""
206 207
207 cl = repo.changelog
208 208 # 1-4b. old servers: Check for new topological heads.
209 209 # Construct {old,new}map with branch = None (topological branch).
210 210 # (code based on update)
211 oldheads = set(h for h in remoteheads if h in cl.nodemap)
211 knownnode = repo.changelog.hasnode # no nodemap until it is filtered
212 oldheads = set(h for h in remoteheads if knownnode(h))
212 213 # all nodes in outgoing.missing are children of either:
213 214 # - an element of oldheads
214 215 # - another element of outgoing.missing
@@ -19,7 +19,7 b' def findcommonincoming(repo, remote, hea'
19 19 "heads" is either the supplied heads, or else the remote's heads.
20 20 """
21 21
22 m = repo.changelog.nodemap
22 knownnode = repo.changelog.hasnode
23 23 search = []
24 24 fetch = set()
25 25 seen = set()
@@ -41,7 +41,7 b' def findcommonincoming(repo, remote, hea'
41 41
42 42 unknown = []
43 43 for h in heads:
44 if h not in m:
44 if not knownnode(h):
45 45 unknown.append(h)
46 46 else:
47 47 base.add(h)
@@ -71,23 +71,23 b' def findcommonincoming(repo, remote, hea'
71 71 elif n in seenbranch:
72 72 repo.ui.debug("branch already found\n")
73 73 continue
74 elif n[1] and n[1] in m: # do we know the base?
74 elif n[1] and knownnode(n[1]): # do we know the base?
75 75 repo.ui.debug("found incomplete branch %s:%s\n"
76 76 % (short(n[0]), short(n[1])))
77 77 search.append(n[0:2]) # schedule branch range for scanning
78 78 seenbranch.add(n)
79 79 else:
80 80 if n[1] not in seen and n[1] not in fetch:
81 if n[2] in m and n[3] in m:
81 if knownnode(n[2]) and knownnode(n[3]):
82 82 repo.ui.debug("found new changeset %s\n" %
83 83 short(n[1]))
84 84 fetch.add(n[1]) # earliest unknown
85 85 for p in n[2:4]:
86 if p in m:
86 if knownnode(p):
87 87 base.add(p) # latest known
88 88
89 89 for p in n[2:4]:
90 if p not in req and p not in m:
90 if p not in req and not knownnode(p):
91 91 r.append(p)
92 92 req.add(p)
93 93 seen.add(n[0])
@@ -114,7 +114,7 b' def findcommonincoming(repo, remote, hea'
114 114 f = 1
115 115 for i in l:
116 116 repo.ui.debug("narrowing %d:%d %s\n" % (f, len(l), short(i)))
117 if i in m:
117 if knownnode(i):
118 118 if f <= 2:
119 119 repo.ui.debug("found new branch changeset %s\n" %
120 120 short(p))
@@ -130,7 +130,7 b' def findcommonincoming(repo, remote, hea'
130 130
131 131 # sanity check our fetch list
132 132 for f in fetch:
133 if f in m:
133 if knownnode(f):
134 134 raise error.RepoError(_("already have changeset ")
135 135 + short(f[:4]))
136 136
General Comments 0
You need to be logged in to leave comments. Login now