mercurial/setdiscovery.py
changeset 41883 1f069f37e601
parent 41882 c98420914c10
child 41884 d5e6ae6e8012
--- a/mercurial/setdiscovery.py	Tue Mar 05 15:52:14 2019 +0100
+++ b/mercurial/setdiscovery.py	Tue Mar 05 15:39:54 2019 +0100
@@ -219,13 +219,13 @@
         for rev in sorted(revs):
             # Always ensure revision has an entry so we don't need to worry
             # about missing keys.
-            children.setdefault(rev, [])
-
+            children[rev] = []
             for prev in parentrevs(rev):
                 if prev == nullrev:
                     continue
-
-                children.setdefault(prev, []).append(rev)
+                c = children.get(prev)
+                if c is not None:
+                    c.append(rev)
 
         _updatesample(revs, revsroots, sample, children.__getitem__)
         assert sample