diff mercurial/bundlerepo.py @ 47150:8d3c2f9d4af7

revlog: use a "radix" to address revlog Instead of pointing to the index directly and to derive the other file from that, we directly provide the radix and let the revlog determine the associated file path internally. This is more robust and will give us more flexibility for picking this file name in the future. Differential Revision: https://phab.mercurial-scm.org/D10576
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:22:36 +0200
parents a07d5cb03a85
children 96ee8ca99f5a
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Mon May 03 12:22:26 2021 +0200
+++ b/mercurial/bundlerepo.py	Mon May 03 12:22:36 2021 +0200
@@ -52,7 +52,7 @@
 
 
 class bundlerevlog(revlog.revlog):
-    def __init__(self, opener, target, indexfile, cgunpacker, linkmapper):
+    def __init__(self, opener, target, radix, cgunpacker, linkmapper):
         # How it works:
         # To retrieve a revision, we need to know the offset of the revision in
         # the bundle (an unbundle object). We store this offset in the index
@@ -61,7 +61,7 @@
         # To differentiate a rev in the bundle from a rev in the revlog, we
         # check revision against repotiprev.
         opener = vfsmod.readonlyvfs(opener)
-        revlog.revlog.__init__(self, opener, target=target, indexfile=indexfile)
+        revlog.revlog.__init__(self, opener, target=target, radix=radix)
         self.bundle = cgunpacker
         n = len(self)
         self.repotiprev = n - 1
@@ -180,7 +180,7 @@
             self,
             opener,
             (revlog_constants.KIND_CHANGELOG, None),
-            self._indexfile,
+            self.radix,
             cgunpacker,
             linkmapper,
         )
@@ -201,7 +201,7 @@
             self,
             opener,
             (revlog_constants.KIND_MANIFESTLOG, dir),
-            self._revlog._indexfile,
+            self._revlog.radix,
             cgunpacker,
             linkmapper,
         )
@@ -233,7 +233,7 @@
             opener,
             # XXX should use the unencoded path
             target=(revlog_constants.KIND_FILELOG, path),
-            indexfile=self._revlog._indexfile,
+            radix=self._revlog.radix,
             cgunpacker=cgunpacker,
             linkmapper=linkmapper,
         )