Mercurial > hg > mercurial-source
changeset 17022:553e8f5aba7a
revlog: add incancestors, a version of ancestors that includes revs listed
ancestors() returns the ancestors of revs provided. This func is like
that except it also includes the revs themselves in the total set of
revs generated.
author | Joshua Redstone <joshua.redstone@fb.com> |
---|---|
date | Fri, 08 Jun 2012 07:59:37 -0700 |
parents | 21e18c608b68 |
children | 0c18aed2fcca |
files | mercurial/revlog.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -404,6 +404,14 @@ seen.add(parent) yield parent + def incancestors(self, revs, stoprev=0): + """Identical to ancestors() except it also generates the + revisions, 'revs'""" + for rev in revs: + yield rev + for rev in self.ancestors(revs, stoprev): + yield rev + def descendants(self, revs): """Generate the descendants of 'revs' in revision order.