undo-files: have the transaction directly tracks and manages journal rename
This is much simpler this way.
undo-files: add a undoname closure to the _write_undo method
We will also needs it when the transaction will take care of the other journal
files, which is soon™.
undo-files: cleanup backup when cleaning undos
Previously, the backups were left behind, by operation cleaning the undo's like
strip, narrow and stream clone.
The remaining elevant in the room is the transaction itself, who does not
properly cleanup undo backup before copying the new ones.
undo-files: factor the vfs map in a repository property
We define it in multiple locations and inconsistencies are appearing. So we now
have a single definition point.
undo-files: add a utility function to read the backup-files definition
We will need it in multiple places. so lets factor the logic around.
undo-files: use the cleanup function in streamclone
Lets use the same code, so that we can fix things only once.
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.
undo-files: use the cleanup function in narrow
Lets use the same code, so that we can fix things only once.
undo-files: extract the cleanup code from strip in a function
This logic is duplicated in multiple places and it missing some important parts.
So lets start dealing with the duplication first.
run-tests: fix a crash when using the coverage options
35bf7f23b84c attempted to transition away from `distutils`, but the `packaging`
code lacks `StrictVersion`. I have no idea when `packaging.version` became
available, but I have it in python 3.6, so that should be good enough. For some
reason, the import checker thinks this is a local import, and needs help to
decide otherwise.
Alternately we could ditch the version check entirely, because `coverage` is
currently at 7.2.1, and the original check was added back in 2010.