dirstate: make `restorebackup` more robust when it is a noop
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 16 Feb 2023 05:03:28 +0100
changeset 50074 8d02dfac072e
parent 50072 a99dcf53eebd
child 50075 a2def50142ea
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)
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)