changeset 50236:53f196622699 stable

dirstate: abstract the reading of the data file in v2 in a method We will need more changes to avoid some race conditions during read, so we first isolate the simple logic before making it more complicated.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 01 Mar 2023 16:05:28 +0100
parents 385977432227
children a3b1ab5f5dee
files mercurial/dirstatemap.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstatemap.py	Mon Feb 27 03:14:30 2023 +0100
+++ b/mercurial/dirstatemap.py	Wed Mar 01 16:05:28 2023 +0100
@@ -124,6 +124,9 @@
             )
         return self._docket
 
+    def _read_v2_data(self):
+        return self._opener.read(self.docket.data_filename())
+
     def write_v2_no_append(self, tr, st, meta, packed):
         old_docket = self.docket
         new_docket = docketmod.DirstateDocket.with_new_uuid(
@@ -283,7 +286,7 @@
             if not self.docket.uuid:
                 return
             testing.wait_on_cfg(self._ui, b'dirstate.post-docket-read-file')
-            st = self._opener.read(self.docket.data_filename())
+            st = self._read_v2_data()
         else:
             st = self._readdirstatefile()