changeset 20709:71df845d86cf

revsets: backout d04aac468bf4 due to performance regressions
author Matt Mackall <mpm@selenic.com>
date Thu, 13 Mar 2014 14:34:32 -0500
parents 17c89e5a5627
children 9c1665f36588
files mercurial/revset.py
diffstat 1 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Wed Mar 12 17:20:26 2014 -0700
+++ b/mercurial/revset.py	Thu Mar 13 14:34:32 2014 -0500
@@ -540,19 +540,18 @@
     return subset.filter(matches)
 
 def _children(repo, narrow, parentset):
+    cs = set()
     if not parentset:
-        return baseset([])
+        return baseset(cs)
     pr = repo.changelog.parentrevs
     minrev = min(parentset)
-
-    def matches(x):
-        if x <= minrev:
-            return False
-        for p in pr(x):
+    for r in narrow:
+        if r <= minrev:
+            continue
+        for p in pr(r):
             if p in parentset:
-                return True
-
-    return narrow.filter(matches)
+                cs.add(r)
+    return baseset(cs)
 
 def children(repo, subset, x):
     """``children(set)``