changeset 43000:8a31294fa25c

upgrade: fix DELTAREUSEFULLADD implementation in revlog.clone If we do a full addition, we need to start from the full text. Differential Revision: https://phab.mercurial-scm.org/D6901
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 27 Sep 2019 13:16:37 +0200
parents 6510c7830838
children bb6902cbbe23
files mercurial/revlog.py
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Fri Sep 27 13:10:47 2019 +0200
+++ b/mercurial/revlog.py	Fri Sep 27 13:16:37 2019 +0200
@@ -2437,21 +2437,21 @@
             # the revlog chunk is a delta.
             cachedelta = None
             rawtext = None
-            if (deltareuse != self.DELTAREUSEFULLADD and destrevlog._lazydelta):
-                dp = self.deltaparent(rev)
-                if dp != nullrev:
-                    cachedelta = (dp, bytes(self._chunk(rev)))
-
-            if not cachedelta:
-                rawtext = self.rawdata(rev)
-
-
             if deltareuse == self.DELTAREUSEFULLADD:
-                destrevlog.addrevision(rawtext, tr, linkrev, p1, p2,
+                text = self.revision(rev)
+                destrevlog.addrevision(text, tr, linkrev, p1, p2,
                                        cachedelta=cachedelta,
                                        node=node, flags=flags,
                                        deltacomputer=deltacomputer)
             else:
+                if destrevlog._lazydelta:
+                    dp = self.deltaparent(rev)
+                    if dp != nullrev:
+                        cachedelta = (dp, bytes(self._chunk(rev)))
+
+                if not cachedelta:
+                    rawtext = self.rawdata(rev)
+
                 ifh = destrevlog.opener(destrevlog.indexfile, 'a+',
                                         checkambig=False)
                 dfh = None