diff -r 342c3c4640b7 -r 379a78001d8e mercurial/dirstatemap.py --- a/mercurial/dirstatemap.py Tue Feb 21 15:10:12 2023 +0100 +++ b/mercurial/dirstatemap.py Wed Mar 01 02:38:20 2023 +0100 @@ -127,6 +127,7 @@ raise error.ProgrammingError( b'dirstate only has a docket in v2 format' ) + self._set_identity() self._docket = docketmod.DirstateDocket.parse( self._readdirstatefile(), self._nodeconstants ) @@ -299,9 +300,6 @@ ### disk interaction def read(self): - # ignore HG_PENDING because identity is used only for writing - self._set_identity() - testing.wait_on_cfg(self._ui, b'dirstate.pre-read-file') if self._use_dirstate_v2: @@ -310,6 +308,7 @@ testing.wait_on_cfg(self._ui, b'dirstate.post-docket-read-file') st = self._read_v2_data() else: + self._set_identity() st = self._readdirstatefile() if not st: @@ -581,6 +580,7 @@ ) parents = self.docket.parents else: + self._set_identity() self._map, parents = rustmod.DirstateMap.new_v1( self._readdirstatefile() )