evolve: move 'troubled()' to smarted usage stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 18 Jun 2015 17:08:11 -0700
branchstable
changeset 1381 61849d45d47e
parent 1380 43dcf62237be
child 1382 c431f827f366
evolve: move 'troubled()' to smarted usage The "new" smarted can be significantly more efficient than the old was. We convert our revset to take advantage of that.
hgext/evolve.py
--- a/hgext/evolve.py	Thu Jun 18 16:14:32 2015 -0700
+++ b/hgext/evolve.py	Thu Jun 18 17:08:11 2015 -0700
@@ -398,9 +398,13 @@
     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'))
+    troubled = revset.baseset(troubled)
+    troubled.sort() # set is non-ordered, enforce order
+    return subset & troubled
 
 ### Obsolescence graph