Fix revlog.children so the real children of the null revision can be calculated.
authorThomas Arendsen Hein <thomas@intevation.de>
Tue, 03 Jul 2007 12:45:33 +0200
changeset 4746 62c56d8f368b
parent 4745 e21a0e12ff10
child 4747 452d171a1b39
child 4784 7cd8a00d08de
Fix revlog.children so the real children of the null revision can be calculated.
mercurial/revlog.py
--- a/mercurial/revlog.py	Tue Jul 03 03:06:40 2007 -0300
+++ b/mercurial/revlog.py	Tue Jul 03 12:45:33 2007 +0200
@@ -756,9 +756,13 @@
         c = []
         p = self.rev(node)
         for r in range(p + 1, self.count()):
-            for pr in self.parentrevs(r):
-                if pr == p:
-                    c.append(self.node(r))
+            prevs = [pr for pr in self.parentrevs(r) if pr != nullrev]
+            if prevs:
+                for pr in prevs:
+                    if pr == p:
+                        c.append(self.node(r))
+            elif p == nullrev:
+                c.append(self.node(r))
         return c
 
     def _match(self, id):