# HG changeset patch # User Boris Feld # Date 2018-09-10 08:11:21 # Node ID bdb41eaa8b597713983ac0b293ce552a1d516da9 # Parent c8514f858788ffebee5f5e01a24d20e00e9d68a8 snapshot: fix line order when skipping over empty deltas The code movement in 37957e07138c introduced an error. Since 8f83a953dddf, we discarded some revisions because they are identical to their delta base (and use that delta base instead). That logic is good, however, in 37957e07138c we mixed up the order of two line, adding the "new" revision to the set of already tested one, instead of the discarded one. So in practice, we were never investigating any revisions in a chain starting with an empty delta. Creating significantly worst delta chain (eg: Mercurial's manifest move goes from about 60MB up to about 80MB). diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py +++ b/mercurial/revlogutils/deltas.py @@ -596,8 +596,8 @@ def _candidategroups(revlog, textlen, p1 for rev in temptative: # skip over empty delta (no need to include them in a chain) while not (rev == nullrev or rev in tested or deltalength(rev)): + tested.add(rev) rev = deltaparent(rev) - tested.add(rev) # filter out revision we tested already if rev in tested: continue