changeset 50129:8d02dfac072e

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)
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 16 Feb 2023 05:03:28 +0100
parents a99dcf53eebd
children a2def50142ea
files mercurial/dirstate.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)