diff mercurial/transaction.py @ 50694:a41eeb877d07

branching: merge with stable
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 18 Jun 2023 00:09:39 +0200
parents 05d429fe84ed
children 0a4efb650b3e 5c3d07950bac
line wrap: on
line diff
--- a/mercurial/transaction.py	Tue Jun 20 02:36:52 2023 +0200
+++ b/mercurial/transaction.py	Sun Jun 18 00:09:39 2023 +0200
@@ -290,6 +290,8 @@
         self._backupjournal = b"%s.backupfiles" % self._journal
         self._backupsfile = opener.open(self._backupjournal, b'w')
         self._backupsfile.write(b'%d\n' % version)
+        # the set of temporary files
+        self._tmp_files = set()
 
         if createmode is not None:
             opener.chmod(self._journal, createmode & 0o666)
@@ -354,6 +356,7 @@
             file in self._newfiles
             or file in self._offsetmap
             or file in self._backupmap
+            or file in self._tmp_files
         ):
             return
         if self._queue:
@@ -368,6 +371,7 @@
             file in self._newfiles
             or file in self._offsetmap
             or file in self._backupmap
+            or file in self._tmp_files
         ):
             return
         if offset:
@@ -439,6 +443,7 @@
         Such files will be deleted when the transaction exits (on both
         failure and success).
         """
+        self._tmp_files.add(tmpfile)
         self._addbackupentry((location, b'', tmpfile, False))
 
     @active