# HG changeset patch # User Pierre-Yves David # Date 1662040154 -7200 # Node ID b5c8524827d20fe2e0ca8fb1234a0fe35a1a36c7 # Parent 2905b78fc52ef83da838efe0965cca3e458aff27 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. diff -r 2905b78fc52e -r b5c8524827d2 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`,