topic: reorder revset for faster evaluation stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2017 15:47:11 +0200
branchstable
changeset 3044 b185beb94df5
parent 3043 033e00be9ce4
child 3045 84882b827932
topic: reorder revset for faster evaluation When running the revset on unfiltered repository, the mutable set can get huge. So removing the obsolete changeset first provide a large speedup. This resolve the performance regression we were seeing since the 6.7.0 release.
hgext3rd/topic/stack.py
--- a/hgext3rd/topic/stack.py	Mon Oct 09 17:42:30 2017 +0200
+++ b/hgext3rd/topic/stack.py	Tue Oct 10 15:47:11 2017 +0200
@@ -34,9 +34,9 @@
         if topic is not None and branch is not None:
             raise error.ProgrammingError('both branch and topic specified (not defined yet)')
         elif topic is not None:
-            trevs = repo.revs("topic(%s) - obsolete()", topic)
+            trevs = repo.revs("not obsolete() and topic(%s) - obsolete()", topic)
         elif branch is not None:
-            trevs = repo.revs("branch(%s) - public() - obsolete() - topic()", branch)
+            trevs = repo.revs("not public() and branch(%s) - obsolete() - topic()", branch)
         else:
             raise error.ProgrammingError('neither branch and topic specified (not defined yet)')
         self._revs = trevs