Patchwork [14,of,15] rawdata: update callers in storageutils

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 15, 2019, 10:40 a.m.
Message ID <e6c5a10e85b7c7edcaf8.1565865612@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/41296/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 15, 2019, 10:40 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1565201510 -7200
#      Wed Aug 07 20:11:50 2019 +0200
# Node ID e6c5a10e85b7c7edcaf89b34aaaa72a6b5121128
# Parent  6e8516552f75a8b1f0e1b2169bdf1004aa48e534
# EXP-Topic rawdata
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r e6c5a10e85b7
rawdata: update callers in storageutils

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.

Patch

diff --git a/mercurial/utils/storageutil.py b/mercurial/utils/storageutil.py
--- a/mercurial/utils/storageutil.py
+++ b/mercurial/utils/storageutil.py
@@ -304,9 +304,9 @@  def emitrevisions(store, nodes, nodesord
 
     ``rawsizefn`` (optional)
        Callable receiving a revision number and returning the length of the
-       ``store.revision(rev, raw=True)``.
+       ``store.rawdata(rev)``.
 
-       If not defined, ``len(store.revision(rev, raw=True))`` will be called.
+       If not defined, ``len(store.rawdata(rev))`` will be called.
 
     ``revdifffn`` (optional)
        Callable receiving a pair of revision numbers that returns a delta
@@ -422,7 +422,7 @@  def emitrevisions(store, nodes, nodesord
         if revisiondata:
             if store.iscensored(baserev) or store.iscensored(rev):
                 try:
-                    revision = store.revision(node, raw=True)
+                    revision = store.rawdata(node)
                 except error.CensoredNodeError as e:
                     revision = e.tombstone
 
@@ -430,19 +430,18 @@  def emitrevisions(store, nodes, nodesord
                     if rawsizefn:
                         baserevisionsize = rawsizefn(baserev)
                     else:
-                        baserevisionsize = len(store.revision(baserev,
-                                                              raw=True))
+                        baserevisionsize = len(store.rawdata(baserev))
 
             elif (baserev == nullrev
                     and deltamode != repository.CG_DELTAMODE_PREV):
-                revision = store.revision(node, raw=True)
+                revision = store.rawdata(node)
                 available.add(rev)
             else:
                 if revdifffn:
                     delta = revdifffn(baserev, rev)
                 else:
-                    delta = mdiff.textdiff(store.revision(baserev, raw=True),
-                                           store.revision(rev, raw=True))
+                    delta = mdiff.textdiff(store.rawdata(baserev),
+                                           store.rawdata(rev))
 
                 available.add(rev)