# HG changeset patch # User Pierre-Yves David # Date 1678875504 -3600 # Node ID 90276164333a690b234dd6599a9975e00a36bdd3 # Parent 972f3e5c94b835fc0640674e2baf0aeaf4f43c3a transaction: properly clean up backup file outside of .hg/store/ Oops. diff -r 972f3e5c94b8 -r 90276164333a mercurial/transaction.py --- a/mercurial/transaction.py Tue Mar 07 17:13:38 2023 +0100 +++ b/mercurial/transaction.py Wed Mar 15 11:18:24 2023 +0100 @@ -141,7 +141,7 @@ checkambig = checkambigfiles and (f, l) in checkambigfiles try: util.copyfile(backuppath, filepath, checkambig=checkambig) - backupfiles.append(b) + backupfiles.append((vfs, b)) except IOError as exc: e_msg = stringutil.forcebytestr(exc) report(_(b"failed to recover %s (%s)\n") % (f, e_msg)) @@ -160,9 +160,9 @@ opener.unlink(backuppath) opener.unlink(journal) try: - for f in backupfiles: - if opener.exists(f): - opener.unlink(f) + for vfs, f in backupfiles: + if vfs.exists(f): + vfs.unlink(f) except (IOError, OSError, error.Abort): # only pure backup file remains, it is sage to ignore any error pass