topic: improve the revset used to return name->nodes mapping
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 23 Jun 2017 10:51:18 +0200
changeset 2657 58719183d383
parent 2656 4a148ca3e80d
child 2660 a51970c07492
topic: improve the revset used to return name->nodes mapping The 'topic' version already filters public changeset out, and skipping 'changectx' creation will helps performance.
hgext3rd/topic/__init__.py
--- a/hgext3rd/topic/__init__.py	Thu Jun 22 09:48:40 2017 +0200
+++ b/hgext3rd/topic/__init__.py	Fri Jun 23 10:51:18 2017 +0200
@@ -138,8 +138,8 @@
         return [repo[r].node()]
     if name not in repo.topics:
         return []
-    return [ctx.node() for ctx in
-            repo.set('not public() and topic(%s)', name)]
+    node = repo.changelog.node
+    return [node(rev) for rev in repo.revs('topic(%s)', name)]
 
 def _nodemap(repo, node):
     ctx = repo[node]