changeset 50306:90276164333a stable

transaction: properly clean up backup file outside of .hg/store/ Oops.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Mar 2023 11:18:24 +0100
parents 972f3e5c94b8
children 70ca1f09ceca
files mercurial/transaction.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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