revlog: synchronise the various attribute holding the index filename
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 25 Oct 2023 01:02:47 +0200
changeset 51089 c2c24b6b97f5
parent 51088 31f143448704
child 51090 de6a8cc24de3
revlog: synchronise the various attribute holding the index filename The segmentfile and the attribute need to be synchronized, let's enforce that.
mercurial/revlog.py
--- 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):