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.
--- 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.