Skip to content
Snippets Groups Projects
Commit df750b81 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

sqlitestore: add an `ancestors` method

We will need it during bundling.

The implementation mirror the one in revlog.
parent 31b4675c
No related branches found
No related tags found
2 merge requests!373merge stable into default,!346backport some bundling improvement
......@@ -429,6 +429,25 @@
entry = self._revisions[self._revtonode[rev]]
return entry.p1rev, entry.p2rev
def ancestors(self, revs, stoprev=0, inclusive=False):
"""Generate the ancestors of 'revs' in reverse revision order.
Does not generate revs lower than stoprev.
See the documentation for ancestor.lazyancestors for more details."""
# first, make sure start revisions aren't filtered
revs = list(revs)
checkrev = self.node
for r in revs:
checkrev(r)
return ancestor.lazyancestors(
self.parentrevs,
revs,
stoprev=stoprev,
inclusive=inclusive,
)
def rev(self, node):
if node == sha1nodeconstants.nullid:
return nullrev
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment