diff mercurial/dirstate.py @ 50084:5b9c3ae807c8

localrepo: "blindly" do a dirstate backup at the end of the transaction Having the file backup mechanism dealing with file backup as benefit. So lets move closer to that. The fact `hg rollback` even needs this is sad. I hope to have the time to implement one of the alternative soon.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 16 Feb 2023 11:42:43 +0100
parents 605f0ccffb43
children 76d44983a398
line wrap: on
line diff
--- a/mercurial/dirstate.py	Thu Feb 16 17:12:21 2023 +0100
+++ b/mercurial/dirstate.py	Thu Feb 16 11:42:43 2023 +0100
@@ -1615,6 +1615,22 @@
         else:
             return self._filename
 
+    def all_file_names(self):
+        """list all filename currently used by this dirstate
+
+        This is only used to do `hg rollback` related backup in the transaction
+        """
+        if not self._opener.exists(self._filename):
+            # no data every written to disk yet
+            return ()
+        elif self._use_dirstate_v2:
+            return (
+                self._filename,
+                self._map.docket.data_filename(),
+            )
+        else:
+            return (self._filename,)
+
     def data_backup_filename(self, backupname):
         if not self._use_dirstate_v2:
             return None