evolve: optimize the computation of the troubled() revset
authorLaurent Charignon <lcharignon@fb.com>
Tue, 05 May 2015 17:15:06 -0700
changeset 1322 f3e0686a63a1
parent 1321 8fa74845eb1f
child 1323 603104c880f7
evolve: optimize the computation of the troubled() revset We take the implementation from _counttroubles() and rely on the more efficient & operation for revset instead of laying down the entire set with %ld.
hgext/evolve.py
--- a/hgext/evolve.py	Tue May 05 13:32:01 2015 -0700
+++ b/hgext/evolve.py	Tue May 05 17:15:06 2015 -0700
@@ -439,9 +439,11 @@
     Changesets with troubles.
     """
     revset.getargs(x, 0, 0, 'troubled takes no arguments')
-    return repo.revs('%ld and (unstable() + bumped() + divergent())',
-                     subset)
-
+    troubled = set()
+    troubled.update(getrevs(repo, 'unstable'))
+    troubled.update(getrevs(repo, 'bumped'))
+    troubled.update(getrevs(repo, 'divergent'))
+    return subset & revset.baseset(troubled)
 
 ### Obsolescence graph