Mercurial > public > mercurial-scm > hg
diff tests/test-ancestor.py @ 23334:59e6e5dd3605
ancestor.missingancestors: turn into a state-keeping class
This allows multiple efficient missing ancestor queries against the same set of
bases. In upcoming patches we'll also define ways to grow the set of bases.
The fact that the test output hasn't changed establishes this patch's
correctness.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 14 Nov 2014 23:44:38 -0800 |
parents | 3b1b8f25443e |
children | 3f28e8cb3066 |
line wrap: on
line diff
--- a/tests/test-ancestor.py Fri Nov 14 13:47:25 2014 -0800 +++ b/tests/test-ancestor.py Fri Nov 14 23:44:38 2014 -0800 @@ -88,7 +88,8 @@ revs = samplerevs(graphnodes) # fast algorithm - h = ancestor.missingancestors(revs, bases, graph.__getitem__) + inc = ancestor.incrementalmissingancestors(graph.__getitem__, bases) + h = inc.missingancestors(revs) # reference slow algorithm r = naivemissingancestors(ancs, revs, bases) if h != r: