diff contrib/perf.py @ 51096:9c8df10ea6e0

revlog: move the `_chunk` 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 02:57:05 +0200
parents a82704902db8
children e8ad6d8de8b8
line wrap: on
line diff
--- a/contrib/perf.py	Wed Oct 25 02:13:18 2023 +0200
+++ b/contrib/perf.py	Thu Oct 19 02:57:05 2023 +0200
@@ -3810,13 +3810,15 @@
 
     def dochunk():
         rl.clearcaches()
+        # chunk used to be available directly on the revlog
+        _chunk = getattr(rl, '_inner', rl)._chunk
         with reading(rl) as fh:
             if fh is not None:
                 for rev in revs:
-                    rl._chunk(rev, df=fh)
+                    _chunk(rev, df=fh)
             else:
                 for rev in revs:
-                    rl._chunk(rev)
+                    _chunk(rev)
 
     chunks = [None]