ancestor: incrementalmissingancestors.basesheads()
This new method will avoid the need to access the `bases` attribute directly
in `setdiscovery`, and to prefilter `nullrev` before passing it to the
`heads()` revset.
Being a method, it can transparently be reimplemented in a Rust (or any native)
version.
Differential Revision: https://phab.mercurial-scm.org/D5582
--- a/mercurial/ancestor.py Mon Jan 14 17:46:14 2019 +0100
+++ b/mercurial/ancestor.py Mon Jan 14 18:36:09 2019 +0100
@@ -11,6 +11,7 @@
from .node import nullrev
from . import (
+ dagop,
policy,
pycompat,
)
@@ -162,6 +163,9 @@
'''grow the ancestor set by adding new bases'''
self.bases.update(newbases)
+ def basesheads(self):
+ return dagop.headrevs(self.bases, self.pfunc)
+
def removeancestorsfrom(self, revs):
'''remove all ancestors of bases from the set revs (in place)'''
bases = self.bases