mercurial/branching/rev_cache.py
changeset 51969 bb281ecf4036
parent 51904 16efed18ae4e
child 51970 4c885d5ff132
--- a/mercurial/branching/rev_cache.py	Fri Sep 27 02:27:54 2024 +0200
+++ b/mercurial/branching/rev_cache.py	Fri Sep 27 15:05:26 2024 +0200
@@ -399,8 +399,9 @@
                 threshold = current_size * REWRITE_RATIO
                 if (max(end, current_size) - start) < threshold:
                     # end affected, let overwrite the bad value
+                    overwritten = min(end, current_size) - start
                     dbg = b"overwriting %d bytes from %d in cache/%s"
-                    dbg %= (current_size - start, start, _rbcrevs)
+                    dbg %= (overwritten, start, _rbcrevs)
                     if end < current_size:
                         extra = b" leaving (%d trailing bytes)"
                         extra %= current_size - end