# HG changeset patch # User Pierre-Yves David # Date 1498117590 -7200 # Node ID db788700ed82a191c328efc737d919387a0bb4db # Parent cf930521f14db1e9e926acdbd95709f7fc40f569 topic-revset: changectx creation in the revset The current mutability filter is very expensive, we use a more direct and efficent way to do so: Before: ! wall 0.213261 comb 0.210000 user 0.210000 sys 0.000000 (best of 45) After: ! wall 0.012195 comb 0.020000 user 0.020000 sys 0.000000 (best of 217) diff -r cf930521f14d -r db788700ed82 hgext3rd/topic/revset.py --- a/hgext3rd/topic/revset.py Wed Jun 21 07:32:11 2017 +0530 +++ b/hgext3rd/topic/revset.py Thu Jun 22 09:46:30 2017 +0200 @@ -3,6 +3,7 @@ from mercurial.i18n import _ from mercurial import ( error, + phases, revset, util, ) @@ -37,7 +38,8 @@ _kind, _pattern, matcher = mkmatcher(topic) else: matcher = lambda t: bool(t) - drafts = subset.filter(lambda r: repo[r].mutable()) + mutable = repo._phasecache.getrevset(repo, (phases.draft, phases.secret)) + drafts = subset & mutable return drafts.filter( lambda r: matcher(repo[r].extra().get(constants.extrakey, '')))