obsolete: prefetch the repo.obsstore used in phasedivergence loop
authorBoris Feld <boris.feld@octobus.net>
Fri, 19 Oct 2018 01:07:08 +0200
changeset 40462 6e2a24550b7e
parent 40461 c7618901584d
child 40463 cfa564037789
obsolete: prefetch the repo.obsstore used in phasedivergence loop The speedup is probably quite negligible, but it cannot hurt.
mercurial/obsolete.py
--- 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):