# HG changeset patch # User Pierre-Yves David # Date 2023-03-06 12:05:08 # Node ID cd680b45a920b109211367767746aaccba4ed350 # Parent 48b90d18e9de71e6d1ce3df6c056602ffa56be94 undo-files: also remove the undo.backupfiles The undo.backupfiles is dealt is directly managed by the transaction instead of going through the `localrepo.undofiles`. We start doing minimal management for it before using `cleanup_undo_files` on more situation. Proper handling of it is an intermediate goal of this series. diff --git a/mercurial/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -119,7 +119,10 @@ def cleanup_undo_files(repo): This is useful to prevent rollback running in situation were it does not make sense. For example after a strip. """ - for undovfs, undofile in repo.undofiles(): + # XXX need to remove the backups themselve too + undo_files = [(repo.svfs, b'undo.backupfiles')] + undo_files.extend(repo.undofiles()) + for undovfs, undofile in undo_files: try: undovfs.unlink(undofile) except OSError as e: