sapling/mercurial/cext
Sune Foldager dca90c364e parsers: fix invariant bug in find_deepest (issue5623)
find_deepest is used to find the "best" ancestors given a list. In the main
loop it keeps an invariant called 'ninteresting' which is supposed to contain
the number of non-zero entries in the 'interesting' array. This invariant is
incorrectly maintained, however, which leads the the algorithm returning an
empty result for certain graphs. This has been fixed.

Also, the 'interesting' array is supposed to fit 2^ancestors values, but is
incorrectly allocated to twice that size. This has been fixed as well.

The tests in test-ancestor.py compare the Python and C versions of the code,
and report the error correctly, since the Python version works correct. Even
so, I have added an additional test against the expected result, in the event
that both algorithms have an identical error in the future.

This fixes issue5623.
2017-07-14 13:48:17 +02:00
..
__init__.py policy: add "cext" package which will host CPython extension modules 2016-08-12 11:06:14 +09:00
base85.c base85: switch to policy importer 2016-08-13 12:08:23 +09:00
bdiff.c bdiff: switch to policy importer 2016-08-13 12:12:50 +09:00
diffhelpers.c diffhelpers: switch to policy importer 2016-08-13 12:15:49 +09:00
dirs.c parsers: switch to policy importer 2016-08-13 12:23:56 +09:00
manifest.c parsers: switch to policy importer 2016-08-13 12:23:56 +09:00
mpatch.c mpatch: switch to policy importer 2016-08-13 12:18:58 +09:00
osutil.c osutil: switch to policy importer 2016-08-12 11:35:17 +09:00
parsers.c cext: mark constant variables 2017-05-21 13:41:01 +09:00
pathencode.c parsers: switch to policy importer 2016-08-13 12:23:56 +09:00
revlog.c parsers: fix invariant bug in find_deepest (issue5623) 2017-07-14 13:48:17 +02:00
util.h cext: mark constant variables 2017-05-21 13:41:01 +09:00