--- 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