diff contrib/perf.py @ 51091:e8ad6d8de8b8

revlog: move the `_chunks` method on the inner object This is a necessary step before being able to move more logic around restoring a revision content there. For now, we do a simple patch for the perf extension logic, when the implementation of the inner object changes, we will likely need some evolution of the API. However this is true of many things in the perf extension. So we will see this later.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 19 Oct 2023 03:00:58 +0200
parents 9c8df10ea6e0
children 2705748ba166
line wrap: on
line diff
--- a/contrib/perf.py	Wed Oct 25 04:40:40 2023 +0200
+++ b/contrib/perf.py	Thu Oct 19 03:00:58 2023 +0200
@@ -3824,13 +3824,14 @@
 
     def dochunkbatch():
         rl.clearcaches()
+        _chunks = getattr(rl, '_inner', rl)._chunks
         with reading(rl) as fh:
             if fh is not None:
                 # Save chunks as a side-effect.
-                chunks[0] = rl._chunks(revs, df=fh)
+                chunks[0] = _chunks(revs, df=fh)
             else:
                 # Save chunks as a side-effect.
-                chunks[0] = rl._chunks(revs)
+                chunks[0] = _chunks(revs)
 
     def docompress(compressor):
         rl.clearcaches()
@@ -4009,7 +4010,7 @@
         slicedchain = tuple(slicechunk(r, chain, targetsize=size))
     data = [segmentforrevs(seg[0], seg[-1])[1] for seg in slicedchain]
     rawchunks = getrawchunks(data, slicedchain)
-    bins = r._chunks(chain)
+    bins = r._inner._chunks(chain)
     text = bytes(bins[0])
     bins = bins[1:]
     text = mdiff.patches(text, bins)