revlogutils: for issue6528 fix, pre-cache nullrev as metadata-free
authorJoerg Sonnenberger <joerg@bec.de>
Sat, 20 Jul 2024 00:44:59 +0200
changeset 51913 576876a518e1
parent 51912 82a94a956c54
child 51914 3dbbb7d913a9
revlogutils: for issue6528 fix, pre-cache nullrev as metadata-free
mercurial/revlogutils/rewrite.py
--- a/mercurial/revlogutils/rewrite.py	Sat Jul 20 00:59:50 2024 +0200
+++ b/mercurial/revlogutils/rewrite.py	Sat Jul 20 00:44:59 2024 +0200
@@ -736,7 +736,7 @@
 
 def filter_delta_issue6528(revlog, deltas_iter):
     """filter incomind deltas to repaire issue 6528 on the fly"""
-    metadata_cache = {}
+    metadata_cache = {nullrev: False}
 
     deltacomputer = deltas.deltacomputer(revlog)
 
@@ -847,7 +847,7 @@
 
             # Set of filerevs (or hex filenodes if `to_report`) that need fixing
             to_fix = set()
-            metadata_cache = {}
+            metadata_cache = {nullrev: False}
             for filerev in fl.revs():
                 affected = _is_revision_affected_fast(
                     repo, fl, filerev, metadata_cache