# HG changeset patch
# User Pierre-Yves David <pierre-yves.da...@octobus.net>
# Date 1565201306 -7200
#      Wed Aug 07 20:08:26 2019 +0200
# Node ID 66af150744d04f984d0300fb71ff93ceb2dc28a9
# Parent  bbe71b5afd02c764639780bfe763348d5e5d7a6b
# EXP-Topic rawdata
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
66af150744d0
rawdata: update caller in revlog

We update callers incrementally because this help bisecting failures. This was
useful during development, so we expect it might be useful again in the future.

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -679,7 +679,7 @@ class revlog(object):
         if l >= 0:
             return l
 
-        t = self.revision(rev, raw=True)
+        t = self.rawdata(rev)
         return len(t)
 
     def size(self, rev):
@@ -1639,8 +1639,8 @@ class revlog(object):
         if rev1 != nullrev and self.deltaparent(rev2) == rev1:
             return bytes(self._chunk(rev2))
 
-        return mdiff.textdiff(self.revision(rev1, raw=True),
-                              self.revision(rev2, raw=True))
+        return mdiff.textdiff(self.rawdata(rev1),
+                              self.rawdata(rev2))
 
     def revision(self, nodeorrev, _df=None, raw=False):
         """return an uncompressed revision of a given node or revision
@@ -2478,7 +2478,7 @@ class revlog(object):
                         cachedelta = (dp, bytes(self._chunk(rev)))
 
                 if not cachedelta:
-                    rawtext = self.revision(rev, raw=True)
+                    rawtext = self.rawdata(rev)
 
 
                 if deltareuse == self.DELTAREUSEFULLADD:
@@ -2556,7 +2556,7 @@ class revlog(object):
                                         'revision having delta stored'))
                 rawtext = self._chunk(rev)
             else:
-                rawtext = self.revision(rev, raw=True)
+                rawtext = self.rawdata(rev)
 
             newrl.addrawrevision(rawtext, tr, self.linkrev(rev), p1, p2, node,
                                  self.flags(rev))
@@ -2614,8 +2614,8 @@ class revlog(object):
             #   rawtext[0:2]=='\1\n'| False  | True   | True  | ?
             #
             # "rawtext" means the raw text stored in revlog data, which
-            # could be retrieved by "revision(rev, raw=True)". "text"
-            # mentioned below is "revision(rev, raw=False)".
+            # could be retrieved by "rawdata(rev)". "text"
+            # mentioned below is "revision(rev)".
             #
             # There are 3 different lengths stored physically:
             #  1. L1: rawsize, stored in revlog index
@@ -2657,7 +2657,7 @@ class revlog(object):
                     self.revision(node)
 
                 l1 = self.rawsize(rev)
-                l2 = len(self.revision(node, raw=True))
+                l2 = len(self.rawdata(node))
 
                 if l1 != l2:
                     yield revlogproblem(
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to