dirstate-v2: no longer register the data-file during transaction stable 6.2.2
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 01 Sep 2022 15:49:14 +0200
branchstable
changeset 49469 b5c8524827d2
parent 49468 2905b78fc52e
child 49470 a601da09a1e2
dirstate-v2: no longer register the data-file during transaction If the data file change during the transaction, we cannot truncate it. The content of the file itself is fine as it will get backed up at the same time as the docket. Leaving the trailing data at the end of failed transaction is fine. The dirstate-v2 format supports it. The dead data will simply we written over if necessary.
mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py	Tue Aug 30 17:05:19 2022 +0200
+++ b/mercurial/dirstatemap.py	Thu Sep 01 15:49:14 2022 +0200
@@ -115,8 +115,6 @@
             self.parents(), len(packed), meta
         )
         data_filename = new_docket.data_filename()
-        if tr:
-            tr.add(data_filename, 0)
         self._opener.write(data_filename, packed)
         # Write the new docket after the new data file has been
         # written. Because `st` was opened with `atomictemp=True`,