revlog.missing(): use sets instead of a dict
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sun, 17 May 2009 02:44:12 +0200
changeset 8453 d1ca637b0773
parent 8446 e1f4343db740
child 8454 6d4bf1c1a003
revlog.missing(): use sets instead of a dict
mercurial/revlog.py
--- a/mercurial/revlog.py	Sun May 17 01:16:56 2009 +0200
+++ b/mercurial/revlog.py	Sun May 17 02:44:12 2009 +0200
@@ -624,18 +624,18 @@
         has.update(common)
 
         # take all ancestors from heads that aren't in has
-        missing = {}
+        missing = set()
         visit = [r for r in heads if r not in has]
         while visit:
             r = visit.pop(0)
             if r in missing:
                 continue
             else:
-                missing[r] = None
+                missing.add(r)
                 for p in self.parentrevs(r):
                     if p not in has:
                         visit.append(p)
-        missing = missing.keys()
+        missing = list(missing)
         missing.sort()
         return [self.node(r) for r in missing]