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.
--- 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