Patchwork D6901: upgrade: fix DELTAREUSEFULLADD implementation in revlog.clone

login
register
mail settings
Submitter phabricator
Date Sept. 28, 2019, 8:28 p.m.
Message ID <d75f6a1ad160e4c3b00cb9cbe08c140e@localhost.localdomain>
Download mbox | patch
Permalink /patch/41821/
State Not Applicable
Headers show

Comments

phabricator - Sept. 28, 2019, 8:28 p.m.
Closed by commit rHG8a31294fa25c: upgrade: fix DELTAREUSEFULLADD implementation in revlog.clone (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6901?vs=16663&id=16670

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6901/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6901

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: marmoute, indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -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