# HG changeset patch # User Pierre-Yves David # Date 1675642921 -3600 # Node ID f4eef08575ce12aa011f00154012c0c2d3012b9b # Parent e358f6e0e50e05be71b92b0f735bcf86c017fc10 dirstate: drop some very fishy looking piece of code This piece of code is marking the **real** dirstate file as a temporary transaction file. This means it get deleted on transaction rollback. This this quite wrong, especially as the comment points out some `dirstate.pending` motivation and the `.pending` file should already be fully managed by the transaction. The only ready I can think of this behavior not having awful results right now is because other transaction logic restore backed up content above the one that got wrongfully deleted. Let us stop doing this anyway, All tests seems happy. diff -r e358f6e0e50e -r f4eef08575ce mercurial/dirstate.py --- a/mercurial/dirstate.py Tue Feb 14 23:05:18 2023 +0100 +++ b/mercurial/dirstate.py Mon Feb 06 01:22:01 2023 +0100 @@ -1527,11 +1527,6 @@ post_finalize=True, ) - # ensure that pending file written above is unlinked at - # failure, even if tr.writepending isn't invoked until the - # end of this transaction - tr.registertmp(filename, location=b'plain') - self._opener.tryunlink(backupname) if self._opener.exists(filename): # hardlink backup is okay because _writedirstate is always called