Mercurial > public > mercurial-scm > hg-stable
diff mercurial/transaction.py @ 50374:05d429fe84ed stable
revlog: fix a bug in revlog splitting
Specifically, if the .i.s files are not added to the transaction,
then a follow-up modification of such a file records it into transaction
as non-empty, which is incorrect.
author | Arseniy Alekseyev <aalekseyev@janestreet.com> |
---|---|
date | Mon, 05 Jun 2023 11:07:08 +0200 |
parents | a445194f0a4d |
children | a41eeb877d07 |
line wrap: on
line diff
--- a/mercurial/transaction.py Thu Jun 01 22:32:21 2023 +0100 +++ b/mercurial/transaction.py Mon Jun 05 11:07:08 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