upgrade: always use full text if "full-add" mode is enable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 12 Jun 2019 14:22:49 +0100
changeset 42688 716d575df275
parent 42687 26a31c88e1a5
child 42689 896fb9deeaf8
upgrade: always use full text if "full-add" mode is enable We should not be using a delta since the goal is to perform a full addition from scratch in all cases. Without this patch, `hg debugupgraderepo --optimize re-delta-fulladd --run` can crash.
mercurial/revlog.py
--- a/mercurial/revlog.py	Sun Aug 04 22:14:26 2019 +0200
+++ b/mercurial/revlog.py	Wed Jun 12 14:22:49 2019 +0100
@@ -2461,7 +2461,8 @@
                 # the revlog chunk is a delta.
                 cachedelta = None
                 rawtext = None
-                if destrevlog._lazydelta:
+                if (deltareuse != self.DELTAREUSEFULLADD
+                        and destrevlog._lazydelta):
                     dp = self.deltaparent(rev)
                     if dp != nullrev:
                         cachedelta = (dp, bytes(self._chunk(rev)))