diff mercurial/transaction.py @ 47286:18415fc918a1

recover: only apply last journal record per file (issue6423) This got broken in 2019 when the size check was introduced. It is most noticable when dealing with transactions that involve an inline to non-inline revlog storage transaction. It wasn't seen as much at the time because the in-memory journal actually de-duplicated the entry implicity, but since 63edc384d3b7 the on-disk journal is used for rollback as well as recover. Differential Revision: https://phab.mercurial-scm.org/D10726
author Joerg Sonnenberger <joerg@bec.de>
date Wed, 19 May 2021 13:45:34 +0200
parents d4ba4d51f85f
children 13dd5bb5492a
line wrap: on
line diff
--- a/mercurial/transaction.py	Wed May 19 13:46:19 2021 +0200
+++ b/mercurial/transaction.py	Wed May 19 13:45:34 2021 +0200
@@ -56,7 +56,7 @@
     unlink=True,
     checkambigfiles=None,
 ):
-    for f, o in entries:
+    for f, o in sorted(dict(entries).items()):
         if o or not unlink:
             checkambig = checkambigfiles and (f, b'') in checkambigfiles
             try: