##// END OF EJS Templates
branchcache: filter obsolete revisions sooner...
marmoute -
r52425:a0ef462c default
parent child Browse files
Show More
@@ -284,16 +284,22 b' class _BaseBranchCache:'
284 """
284 """
285 starttime = util.timer()
285 starttime = util.timer()
286 cl = repo.changelog
286 cl = repo.changelog
287 # Faster than using ctx.obsolete()
288 obsrevs = obsolete.getrevs(repo, b'obsolete')
287 # collect new branch entries
289 # collect new branch entries
288 newbranches = {}
290 newbranches = {}
289 getbranchinfo = repo.revbranchcache().branchinfo
291 getbranchinfo = repo.revbranchcache().branchinfo
290 max_rev = -1
292 max_rev = -1
291 for r in revgen:
293 for r in revgen:
294 max_rev = max(max_rev, r)
295 if r in obsrevs:
296 # We ignore obsolete changesets as they shouldn't be
297 # considered heads.
298 continue
292 branch, closesbranch = getbranchinfo(r)
299 branch, closesbranch = getbranchinfo(r)
293 newbranches.setdefault(branch, []).append(r)
300 newbranches.setdefault(branch, []).append(r)
294 if closesbranch:
301 if closesbranch:
295 self._closednodes.add(cl.node(r))
302 self._closednodes.add(cl.node(r))
296 max_rev = max(max_rev, r)
297 if max_rev < 0:
303 if max_rev < 0:
298 msg = "running branchcache.update without revision to update"
304 msg = "running branchcache.update without revision to update"
299 raise error.ProgrammingError(msg)
305 raise error.ProgrammingError(msg)
@@ -306,9 +312,6 b' class _BaseBranchCache:'
306 # use the faster unfiltered parent accessor.
312 # use the faster unfiltered parent accessor.
307 parentrevs = repo.unfiltered().changelog.parentrevs
313 parentrevs = repo.unfiltered().changelog.parentrevs
308
314
309 # Faster than using ctx.obsolete()
310 obsrevs = obsolete.getrevs(repo, b'obsolete')
311
312 for branch, newheadrevs in newbranches.items():
315 for branch, newheadrevs in newbranches.items():
313 # For every branch, compute the new branchheads.
316 # For every branch, compute the new branchheads.
314 # A branchhead is a revision such that no descendant is on
317 # A branchhead is a revision such that no descendant is on
@@ -349,11 +352,6 b' class _BaseBranchCache:'
349 bheadset = {cl.rev(node) for node in bheads}
352 bheadset = {cl.rev(node) for node in bheads}
350 uncertain = set()
353 uncertain = set()
351 for newrev in sorted(newheadrevs):
354 for newrev in sorted(newheadrevs):
352 if newrev in obsrevs:
353 # We ignore obsolete changesets as they shouldn't be
354 # considered heads.
355 continue
356
357 if not bheadset:
355 if not bheadset:
358 bheadset.add(newrev)
356 bheadset.add(newrev)
359 continue
357 continue
General Comments 0
You need to be logged in to leave comments. Login now