changeset 35136:82680919d75e

obsolete: drop usage of changectx in '_computephasedivergentset' Changectx are expensive and not needed there. The use of `repo.set` denote old code that predate the introduction of `repo.revs` that we now use. On my mercurial repository 495 draft: before: 0.010275 second after: 0.008832 second On a mercurial repository with 115973 draft: before: 0.899255 second after: 0.397131 second
author Boris Feld <boris.feld@octobus.net>
date Sun, 19 Nov 2017 05:23:12 +0100
parents e46f0b653002
children 5cd6682b5a90
files mercurial/obsolete.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsolete.py	Sat Nov 25 16:01:27 2017 +0800
+++ b/mercurial/obsolete.py	Sun Nov 19 05:23:12 2017 +0100
@@ -994,10 +994,10 @@
     public = phases.public
     cl = repo.changelog
     torev = cl.nodemap.get
-    for ctx in repo.set('(not public()) and (not obsolete())'):
-        rev = ctx.rev()
+    tonode = cl.node
+    for rev in repo.revs('(not public()) and (not obsolete())'):
         # We only evaluate mutable, non-obsolete revision
-        node = ctx.node()
+        node = tonode(rev)
         # (future) A cache of predecessors may worth if split is very common
         for pnode in obsutil.allpredecessors(repo.obsstore, [node],
                                    ignoreflags=bumpedfix):