changeset 16396:03e408a122c4 stable

revset: avoid set duplication in roots()
author Patrick Mezard <patrick@mezard.eu>
date Sun, 08 Apr 2012 11:14:56 +0200
parents c3fd35f88fbb
children a232a1b5ae9b c3aedd526d53
files mercurial/revset.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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]