comparison mercurial/revlogutils/deltas.py @ 40428:bafa1c4bb7a8 stable

sparse-revlog: only refine delta candidates in the sparse case (issue6006) Starting with 5aef5afa8654, a valid delta parent might be "refined". This allows repository using sparse-revlog to produce better delta chain by using better intermediate snapshot base. However, this refining step was performed in all cases, including for repository not using sparse-revlog. This could produce a strange chain in the general delta case and corrupted repository in the non-general delta case. We now skip this step unless sparse-revlog is in use. In issue 6006, Yuya Nishihara provided a test case using an external repository, so we did not include it. Finding "laboratory" condition to reproduce this case and implementing an efficient test reproducing it is a bit tricky. We do not foresee to have the time to provide one by the release date. Differential Revision: https://phab.mercurial-scm.org/D5197
author Boris Feld <boris.feld@octobus.net>
date Wed, 31 Oct 2018 11:02:08 +0100
parents b63dee7bd0d9
children 324ba8b14d78
comparison
equal deleted inserted replaced
40426:588f1e9a4d16 40428:bafa1c4bb7a8
643 return 643 return
644 for candidates in _rawgroups(revlog, p1, p2, cachedelta): 644 for candidates in _rawgroups(revlog, p1, p2, cachedelta):
645 good = yield candidates 645 good = yield candidates
646 if good is not None: 646 if good is not None:
647 break 647 break
648
649 # If sparse revlog is enabled, we can try to refine the available deltas
650 if not revlog._sparserevlog:
651 yield None
652 return
648 653
649 # if we have a refinable value, try to refine it 654 # if we have a refinable value, try to refine it
650 if good is not None and good not in (p1, p2) and revlog.issnapshot(good): 655 if good is not None and good not in (p1, p2) and revlog.issnapshot(good):
651 # refine snapshot down 656 # refine snapshot down
652 previous = None 657 previous = None