changeset 38683:ddd2165438cd

phases: micro-optimize newheads() to not create context objects
author Yuya Nishihara <yuya@tcha.org>
date Sat, 14 Jul 2018 13:21:49 +0900
parents 88efb7d6bcb6
children 07b551a4df44
files mercurial/phases.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/phases.py	Sat Jul 14 13:19:18 2018 +0900
+++ b/mercurial/phases.py	Sat Jul 14 13:21:49 2018 +0900
@@ -665,9 +665,8 @@
     * `heads`: define the first subset
     * `roots`: define the second we subtract from the first"""
     repo = repo.unfiltered()
-    revset = repo.set('heads(::%ln - (%ln::%ln))', heads, roots, heads)
-    return [c.node() for c in revset]
-
+    revs = repo.revs('heads(::%ln - (%ln::%ln))', heads, roots, heads)
+    return pycompat.maplist(repo.changelog.node, revs)
 
 def newcommitphase(ui):
     """helper to get the target phase of new commit