Mercurial > public > mercurial-scm > hg-stable
diff hgext/git/gitlog.py @ 49382:1e12ea7d8435 stable
git: copy findmissingrevs() from revlog.py to gitlog.py (issue6472)
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Wed, 06 Jul 2022 11:52:26 +0400 |
parents | ef5f5f1cbd90 |
children | d91b55371d6f |
line wrap: on
line diff
--- a/hgext/git/gitlog.py Mon Jul 04 17:16:13 2022 +0400 +++ b/hgext/git/gitlog.py Wed Jul 06 11:52:26 2022 +0400 @@ -282,6 +282,30 @@ 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. + + 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() + + inc = self.incrementalmissingrevs(common=common) + return inc.missingancestors(heads) + def findmissing(self, common=None, heads=None): """Return the ancestors of heads that are not ancestors of common.