revlog: add a children function
authormpm@selenic.com
Wed, 15 Jun 2005 19:48:04 -0800
changeset 370 c90385d82aec
parent 369 09f24af48b82
child 371 6e3436082697
revlog: add a children function -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 revlog: add a children function manifest hash: eda39cb99d0df5b3262d97a9e161a8acceb1da3d -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCsPZ0ywK+sNU5EO8RAiAcAJ9D+y8zQ/Gai7CpTkfTamPFxmvVRACcDRv9 5HkupYyrxslGnGJpELaF1is= =zf1d -----END PGP SIGNATURE-----
mercurial/revlog.py
--- a/mercurial/revlog.py	Wed Jun 15 19:23:09 2005 -0800
+++ b/mercurial/revlog.py	Wed Jun 15 19:48:04 2005 -0800
@@ -175,6 +175,19 @@
             for pn in self.parents(n):
                 p[pn] = 1
         return h
+
+    def children(self, node):
+        c = []
+        p = self.rev(node)
+        for r in range(p + 1, self.count()):
+            n = self.node(r)
+            for pn in self.parents(n):
+                if pn == p:
+                    c.append(p)
+                    continue
+                elif pn == nullid:
+                    continue
+        return c
     
     def lookup(self, id):
         try: