diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -875,6 +875,8 @@ if common is None: common = [nullrev] + if rustext is not None: + return rustext.ancestor.MissingAncestors(self.index, common) return ancestor.incrementalmissingancestors(self.parentrevs, common) def findmissingrevs(self, common=None, heads=None): diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py --- a/mercurial/setdiscovery.py +++ b/mercurial/setdiscovery.py @@ -186,9 +186,15 @@ """the heads of the known common set""" # heads(common) == heads(common.bases) since common represents # common.bases and all its ancestors + bases = self._common.bases + if callable(bases): + # This happens for Rust exported object, and we don't know + # at the moment how to make an equivalent of property for them + bases = bases() + # The presence of nullrev will confuse heads(). So filter it out. return set(self._repo.revs('heads(%ld)', - self._common.bases - {nullrev})) + (r for r in bases if r != nullrev))) def findcommonheads(ui, local, remote, initialsamplesize=100,