Mercurial > hg
changeset 370:c90385d82aec
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-----
author | mpm@selenic.com |
---|---|
date | Wed, 15 Jun 2005 19:48:04 -0800 |
parents | 09f24af48b82 |
children | 6e3436082697 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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: