diff --git a/mercurial/transaction.py b/mercurial/transaction.py --- a/mercurial/transaction.py +++ b/mercurial/transaction.py @@ -690,6 +690,11 @@ class transaction(util.transactional): """write transaction data for possible future undo call""" if self._undoname is None: return + cleanup_undo_files( + self._report, + self._vfsmap, + undo_prefix=self._undoname, + ) def undoname(fn: bytes) -> bytes: base, name = os.path.split(fn) diff --git a/tests/test-hardlinks.t b/tests/test-hardlinks.t --- a/tests/test-hardlinks.t +++ b/tests/test-hardlinks.t @@ -141,8 +141,6 @@ Create a non-inlined filelog in r3: 1 r3/.hg/store/phaseroots 1 r3/.hg/store/requires 1 r3/.hg/store/undo - 1 r3/.hg/store/undo.backup.fncache (repofncache !) - 1 r3/.hg/store/undo.backup.phaseroots 1 r3/.hg/store/undo.backupfiles Push to repo r1 should break up most hardlinks in r2: @@ -253,8 +251,6 @@ r4 has hardlinks in the working dir (not 2 r4/.hg/store/phaseroots 2 r4/.hg/store/requires 2 r4/.hg/store/undo - 2 r4/.hg/store/undo.backup.fncache (repofncache !) - 2 r4/.hg/store/undo.backup.phaseroots 2 r4/.hg/store/undo.backupfiles [24] r4/.hg/undo.backup.branch (re) 2 r4/\.hg/undo\.backup\.dirstate (re) @@ -308,8 +304,6 @@ Update back to revision 12 in r4 should 2 r4/.hg/store/phaseroots 2 r4/.hg/store/requires 2 r4/.hg/store/undo - 2 r4/.hg/store/undo.backup.fncache (repofncache !) - 2 r4/.hg/store/undo.backup.phaseroots 2 r4/.hg/store/undo.backupfiles [23] r4/.hg/undo.backup.branch (re) 2 r4/\.hg/undo\.backup\.dirstate (re) diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t --- a/tests/test-largefiles-cache.t +++ b/tests/test-largefiles-cache.t @@ -189,7 +189,6 @@ conditional above. $ find src/.hg/largefiles/* | egrep "(dirstate|$hash)" | sort src/.hg/largefiles/dirstate src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 - src/.hg/largefiles/undo.backup.dirstate Verify that backwards compatibility is maintained for old storage layout $ mv src/.hg/largefiles/$hash share_dst/.hg/largefiles diff --git a/tests/test-persistent-nodemap.t b/tests/test-persistent-nodemap.t --- a/tests/test-persistent-nodemap.t +++ b/tests/test-persistent-nodemap.t @@ -811,8 +811,7 @@ downgrading - manifest $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' - undo.backup.00changelog.n - undo.backup.00manifest.n + [1] $ hg debugnodemap --metadata @@ -858,8 +857,6 @@ upgrading 00changelog.n 00manifest-*.nd (glob) 00manifest.n - undo.backup.00changelog.n - undo.backup.00manifest.n $ hg debugnodemap --metadata uid: * (glob)