# HG changeset patch
# User Pierre-Yves David <pierre-yves.da...@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.

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)
 
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to