# HG changeset patch # User Pierre-Yves David # Date 1677683128 -3600 # Node ID 53f19662269970b8a77aa68755a86a0bfe5a8c00 # Parent 3859774322273289c356953036a2ab729ba6039e 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. diff -r 385977432227 -r 53f196622699 mercurial/dirstatemap.py --- 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()