# HG changeset patch # User Pierre-Yves David # Date 2024-08-04 08:47:29 # Node ID 2f88df88f5b9fa2d2f9e0adc6c7b762201f8640e # Parent 81be242a1b5cbdfa6ba4d4c6b22a5a550dfb7071 manifest: type and fix unhexlify Some part of that function seems to date back from Python 2. It raise question about whether this function is useful or not, but let us just fix it for now. This was caught by pytype. diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -143,10 +143,10 @@ class lazymanifestiterentries: __next__ = next -def unhexlify(data, extra, pos, length): +def unhexlify(data: bytes, extra: int, pos, length: int): s = bin(data[pos : pos + length]) if extra: - s += chr(extra & 0xFF) + s += bytes([extra & 0xFF]) return s