undo-files: cleanup legacy files when applicable stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 07 Mar 2023 03:42:40 +0100
branchstable
changeset 50304 862969b6c359
parent 50303 92734603e33e
child 50320 adecb1ab4a0d
undo-files: cleanup legacy files when applicable The "journal" code is much more compact in 6.4, and so is the "undo" files as a result. However the previous version were much noisier, so let us cleanup undo files from older version too.
mercurial/transaction.py
--- a/mercurial/transaction.py	Mon Mar 06 22:16:43 2023 +0100
+++ b/mercurial/transaction.py	Tue Mar 07 03:42:40 2023 +0100
@@ -43,6 +43,14 @@
 UNDO_BACKUP = b'%s.backupfiles'
 
 UNDO_FILES_MAY_NEED_CLEANUP = [
+    # legacy entries that might exists on disk from previous version:
+    (b'store', b'%s.narrowspec'),
+    (b'plain', b'%s.narrowspec.dirstate'),
+    (b'plain', b'%s.branch'),
+    (b'plain', b'%s.bookmarks'),
+    (b'store', b'%s.phaseroots'),
+    (b'plain', b'%s.dirstate'),
+    # files actually in uses today:
     (b'plain', b'%s.desc'),
     # Always delete undo last to make sure we detect that a clean up is needed if
     # the process is interrupted.