Mercurial > hg
changeset 23337:3a8a763f4197
revlog: add a method to get missing revs incrementally
This will turn out to be useful for discovery.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Sun, 16 Nov 2014 00:39:48 -0800 |
parents | 4178ad511edf |
children | d8f5b2f50f41 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py Sat Nov 15 19:26:20 2014 -0800 +++ b/mercurial/revlog.py Sun Nov 16 00:39:48 2014 -0800 @@ -495,6 +495,20 @@ missing.sort() return has, [self.node(r) for r in missing] + def incrementalmissingrevs(self, common=None): + """Return an object that can be used to incrementally compute the + revision numbers of the ancestors of arbitrary sets that are not + ancestors of common. This is an ancestor.incrementalmissingancestors + object. + + 'common' is a list of revision numbers. If common is not supplied, uses + nullrev. + """ + if common is None: + common = [nullrev] + + return ancestor.incrementalmissingancestors(self.parentrevs, common) + def findmissingrevs(self, common=None, heads=None): """Return the revision numbers of the ancestors of heads that are not ancestors of common.