changeset 40514:6e2a24550b7e

obsolete: prefetch the repo.obsstore used in phasedivergence loop The speedup is probably quite negligible, but it cannot hurt.
author Boris Feld <boris.feld@octobus.net>
date Fri, 19 Oct 2018 01:07:08 +0200
parents c7618901584d
children cfa564037789
files mercurial/obsolete.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsolete.py	Fri Oct 19 00:53:18 2018 +0200
+++ b/mercurial/obsolete.py	Fri Oct 19 01:07:08 2018 +0200
@@ -916,11 +916,12 @@
     cl = repo.changelog
     torev = cl.nodemap.get
     tonode = cl.node
+    obsstore = repo.obsstore
     for rev in repo.revs('(not public()) and (not obsolete())'):
         # We only evaluate mutable, non-obsolete revision
         node = tonode(rev)
         # (future) A cache of predecessors may worth if split is very common
-        for pnode in obsutil.allpredecessors(repo.obsstore, [node],
+        for pnode in obsutil.allpredecessors(obsstore, [node],
                                    ignoreflags=bumpedfix):
             prev = torev(pnode) # unfiltered! but so is phasecache
             if (prev is not None) and (phase(repo, prev) <= public):