Mercurial > public > mercurial-scm > hg
comparison mercurial/branching/rev_cache.py @ 51969:bb281ecf4036
rev-branch-cache: fix message about overwritten data
If there is data at the end we ignore, we should not count them as overwritten.
This reveal that we something don't overwrite anything, this will be taken car
of in the next changeset.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 27 Sep 2024 15:05:26 +0200 |
parents | 16efed18ae4e |
children | 4c885d5ff132 |
comparison
equal
deleted
inserted
replaced
51968:dd3ccda3abc8 | 51969:bb281ecf4036 |
---|---|
397 start = 0 | 397 start = 0 |
398 if current_size != start: | 398 if current_size != start: |
399 threshold = current_size * REWRITE_RATIO | 399 threshold = current_size * REWRITE_RATIO |
400 if (max(end, current_size) - start) < threshold: | 400 if (max(end, current_size) - start) < threshold: |
401 # end affected, let overwrite the bad value | 401 # end affected, let overwrite the bad value |
402 overwritten = min(end, current_size) - start | |
402 dbg = b"overwriting %d bytes from %d in cache/%s" | 403 dbg = b"overwriting %d bytes from %d in cache/%s" |
403 dbg %= (current_size - start, start, _rbcrevs) | 404 dbg %= (overwritten, start, _rbcrevs) |
404 if end < current_size: | 405 if end < current_size: |
405 extra = b" leaving (%d trailing bytes)" | 406 extra = b" leaving (%d trailing bytes)" |
406 extra %= current_size - end | 407 extra %= current_size - end |
407 dbg += extra | 408 dbg += extra |
408 dbg += b'\n' | 409 dbg += b'\n' |