revset: avoid set duplication in roots() stable
authorPatrick Mezard <patrick@mezard.eu>
Sun, 08 Apr 2012 11:14:56 +0200
branchstable
changeset 16396 03e408a122c4
parent 16395 c3fd35f88fbb
child 16415 a232a1b5ae9b
child 16416 c3aedd526d53
revset: avoid set duplication in roots()
mercurial/revset.py
--- a/mercurial/revset.py	Sun Apr 08 11:13:06 2012 +0200
+++ b/mercurial/revset.py	Sun Apr 08 11:14:56 2012 +0200
@@ -323,13 +323,12 @@
                     break
     return s
 
-def _children(repo, narrow, s):
+def _children(repo, narrow, parentset):
     cs = set()
     pr = repo.changelog.parentrevs
-    s = set(s)
     for r in narrow:
         for p in pr(r):
-            if p in s:
+            if p in parentset:
                 cs.add(r)
     return cs
 
@@ -337,7 +336,7 @@
     """``children(set)``
     Child changesets of changesets in set.
     """
-    s = getset(repo, range(len(repo)), x)
+    s = set(getset(repo, range(len(repo)), x))
     cs = _children(repo, subset, s)
     return [r for r in subset if r in cs]