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.
--- 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`,