# HG changeset patch # User Pierre-Yves David # Date 1676520208 -3600 # Node ID 8d02dfac072e29f6ea2a7fcbf435e58e155f9c89 # Parent a99dcf53eebd54b82d9174fb276e28b6b1a052df dirstate: make `restorebackup` more robust when it is a noop If there are no data_file, we might not be able to determine its filename. Which can be safely ignored. (all this code is on the way out anyway) diff -r a99dcf53eebd -r 8d02dfac072e mercurial/dirstate.py --- a/mercurial/dirstate.py Thu Feb 16 00:33:15 2023 +0100 +++ b/mercurial/dirstate.py Thu Feb 16 05:03:28 2023 +0100 @@ -1671,7 +1671,7 @@ # there was no file backup, delete existing files filename = self._actualfilename(tr) data_file = None - if self._use_dirstate_v2: + if self._use_dirstate_v2 and self._map.docket.uuid is not None: data_file = self._map.docket.data_filename() if o.exists(filename): o.unlink(filename)