snapshot: fix line order when skipping over empty deltas
authorBoris Feld <boris.feld@octobus.net>
Mon, 10 Sep 2018 10:11:21 +0200
changeset 39594 bdb41eaa8b59
parent 39593 c8514f858788
child 39595 a911932d5003
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).
mercurial/revlogutils/deltas.py
--- a/mercurial/revlogutils/deltas.py	Wed Sep 12 23:10:59 2018 -0400
+++ b/mercurial/revlogutils/deltas.py	Mon Sep 10 10:11:21 2018 +0200
@@ -596,8 +596,8 @@
         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