# HG changeset patch # User Siddharth Agarwal # Date 1353955704 28800 # Node ID 7ef00d09ef35903d0aa15fd558260449296a37aa # Parent e1b9a78a7aedc96f52ef5cdd6ee424dba079b4a2 revlog: add rev-specific variant of findmissing This will be used by rebase in an upcoming commit. diff -r e1b9a78a7aed -r 7ef00d09ef35 mercurial/revlog.py --- a/mercurial/revlog.py Mon Nov 26 11:02:48 2012 -0800 +++ b/mercurial/revlog.py Mon Nov 26 10:48:24 2012 -0800 @@ -429,6 +429,29 @@ missing.sort() return has, [self.node(r) for r in missing] + def findmissingrevs(self, common=None, heads=None): + """Return the revision numbers of the ancestors of heads that + are not ancestors of common. + + More specifically, return a list of revision numbers corresponding to + nodes N such that every N satisfies the following constraints: + + 1. N is an ancestor of some node in 'heads' + 2. N is not an ancestor of any node in 'common' + + The list is sorted by revision number, meaning it is + topologically sorted. + + 'heads' and 'common' are both lists of revision numbers. If heads is + not supplied, uses all of the revlog's heads. If common is not + supplied, uses nullid.""" + if common is None: + common = [nullrev] + if heads is None: + heads = self.headrevs() + + return ancestor.missingancestors(heads, common, self.parentrevs) + def findmissing(self, common=None, heads=None): """Return the ancestors of heads that are not ancestors of common.