Patchwork [11,of,16] revlog: switch findmissing* methods to incrementalmissingrevs

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 16, 2014, 9:17 a.m.
Message ID <96be9921a682a538e358.1416129433@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/6758/
State Accepted
Commit d8f5b2f50f41eb7f785f17a5ae792f215423a2b5
Headers show

Comments

Siddharth Agarwal - Nov. 16, 2014, 9:17 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1416012760 28800
#      Fri Nov 14 16:52:40 2014 -0800
# Node ID 96be9921a682a538e358070b78e5ae0f71d1cc44
# Parent  3b089459e1e94936b0d6883c1b8a804ae57bc810
revlog: switch findmissing* methods to incrementalmissingrevs

This will allow us to remove ancestor.missingancestors in an upcoming patch.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -530,7 +530,8 @@ 
         if heads is None:
             heads = self.headrevs()
 
-        return ancestor.missingancestors(heads, common, self.parentrevs)
+        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.
@@ -555,8 +556,8 @@ 
         common = [self.rev(n) for n in common]
         heads = [self.rev(n) for n in heads]
 
-        return [self.node(r) for r in
-                ancestor.missingancestors(heads, common, self.parentrevs)]
+        inc = self.incrementalmissingrevs(common=common)
+        return [self.node(r) for r in inc.missingancestors(heads)]
 
     def nodesbetween(self, roots=None, heads=None):
         """Return a topological path from 'roots' to 'heads'.