[PATCH 10 of 16] revlog: add a method to get missing revs incrementally
Siddharth Agarwal
sid0 at fb.com
Sun Nov 16 03:17:12 CST 2014
# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1416127188 28800
# Sun Nov 16 00:39:48 2014 -0800
# Node ID 3b089459e1e94936b0d6883c1b8a804ae57bc810
# Parent 12491c5d3352731b1602e2f8e8d4b8aa445964a8
revlog: add a method to get missing revs incrementally
This will turn out to be useful for discovery.
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -495,6 +495,20 @@
missing.sort()
return has, [self.node(r) for r in missing]
+ def incrementalmissingrevs(self, common=None):
+ """Return an object that can be used to incrementally compute the
+ revision numbers of the ancestors of arbitrary sets that are not
+ ancestors of common. This is an ancestor.incrementalmissingancestors
+ object.
+
+ 'common' is a list of revision numbers. If common is not supplied, uses
+ nullrev.
+ """
+ if common is None:
+ common = [nullrev]
+
+ 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 information about the Mercurial-devel
mailing list