##// END OF EJS Templates
branchmap: pre-filter topological heads before ancestors based filtering...
Pierre-Yves David -
r22357:9c3c3dc1 default
parent child Browse files
Show More
@@ -239,6 +239,10 b' class branchcache(dict):'
239 newbranches.setdefault(branch, []).append(r)
239 newbranches.setdefault(branch, []).append(r)
240 if closesbranch:
240 if closesbranch:
241 self._closednodes.add(cl.node(r))
241 self._closednodes.add(cl.node(r))
242
243 # fetch current topological heads to speed up filtering
244 topoheads = set(cl.headrevs())
245
242 # if older branchheads are reachable from new ones, they aren't
246 # if older branchheads are reachable from new ones, they aren't
243 # really branchheads. Note checking parents is insufficient:
247 # really branchheads. Note checking parents is insufficient:
244 # 1 (branch a) -> 2 (branch b) -> 3 (branch a)
248 # 1 (branch a) -> 2 (branch b) -> 3 (branch a)
@@ -255,8 +259,11 b' class branchcache(dict):'
255 # This prunes out two kinds of heads - heads that are superseded by
259 # This prunes out two kinds of heads - heads that are superseded by
256 # a head in newheadrevs, and newheadrevs that are not heads because
260 # a head in newheadrevs, and newheadrevs that are not heads because
257 # an existing head is their descendant.
261 # an existing head is their descendant.
258 ancestors = set(cl.ancestors(newheadrevs, min(bheadset)))
262 uncertain = bheadset - topoheads
259 bheadset -= ancestors
263 if uncertain:
264 floorrev = min(uncertain)
265 ancestors = set(cl.ancestors(newheadrevs, floorrev))
266 bheadset -= ancestors
260 bheadrevs = sorted(bheadset)
267 bheadrevs = sorted(bheadset)
261 self[branch] = [cl.node(rev) for rev in bheadrevs]
268 self[branch] = [cl.node(rev) for rev in bheadrevs]
262 tiprev = bheadrevs[-1]
269 tiprev = bheadrevs[-1]
General Comments 0
You need to be logged in to leave comments. Login now