changeset 51089:c2c24b6b97f5

revlog: synchronise the various attribute holding the index filename The segmentfile and the attribute need to be synchronized, let's enforce that.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 25 Oct 2023 01:02:47 +0200
parents 31f143448704
children de6a8cc24de3
files mercurial/revlog.py
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Thu Oct 19 01:50:07 2023 +0200
+++ b/mercurial/revlog.py	Wed Oct 25 01:02:47 2023 +0200
@@ -358,7 +358,7 @@
         self.opener = opener
         self.index = index
 
-        self.index_file = index_file
+        self.__index_file = index_file
         self.data_file = data_file
         self.sidedata_file = sidedata_file
         self.inline = inline
@@ -381,6 +381,16 @@
             self.data_config.chunk_cache_size,
         )
 
+    @property
+    def index_file(self):
+        return self.__index_file
+
+    @index_file.setter
+    def index_file(self, new_index_file):
+        self.__index_file = new_index_file
+        if self.inline:
+            self._segmentfile.filename = new_index_file
+
     # Derived from index values.
 
     def start(self, rev):