diff hgext/evolve.py @ 1385:c2584407afbf stable

evolve: move 'successors()' to smarted usage The "new" smarted can be significantly more efficient than the old was. We convert our revset to take advantage of that.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 18 Jun 2015 16:15:21 -0700
parents 64c8b8c27811
children b5eaec8a53d0
line wrap: on
line diff
--- a/hgext/evolve.py	Thu Jun 18 16:15:13 2015 -0700
+++ b/hgext/evolve.py	Thu Jun 18 16:15:21 2015 -0700
@@ -458,6 +458,7 @@
                 sr = nm.get(sub)
                 if sr is not None:
                     cs.add(sr)
+    cs -= repo.changelog.filteredrevs # nodemap has no filtering
     return cs
 
 def _allsuccessors(repo, s, haltonflags=0):  # XXX we need a better naming
@@ -539,8 +540,9 @@
     Immediate successors of changesets in set.
     """
     s = revset.getset(repo, revset.fullreposet(repo), x)
-    cs = _successors(repo, s)
-    return [r for r in subset if r in cs]
+    s = revset.baseset(_successors(repo, s))
+    s.sort()
+    return subset & s
 
 @eh.revset('allsuccessors')
 def revsetallsuccessors(repo, subset, x):