# HG changeset patch # User Matt Harbison # Date 2024-07-10 21:16:19 # Node ID 138ab7c6a6ff1f902c7e6064e6fec4878af046a7 # Parent 6fc31e7bd5dbadef06f21bdab12f6bdaf5d097a4 typing: add some trivial type hints to `mercurial/bundlecaches.py` The function is meant for extensions, but it wasn't obvious what was expected without looking through the code. Also, pytype couldn't figure it out either. diff --git a/mercurial/bundlecaches.py b/mercurial/bundlecaches.py --- a/mercurial/bundlecaches.py +++ b/mercurial/bundlecaches.py @@ -30,7 +30,7 @@ CB_MANIFEST_FILE = b'clonebundles.manife CLONEBUNDLESCHEME = b"peer-bundle-cache://" -def get_manifest(repo): +def get_manifest(repo) -> bytes: """get the bundle manifest to be served to a client from a server""" raw_text = repo.vfs.tryread(CB_MANIFEST_FILE) entries = [e.split(b' ', 1) for e in raw_text.splitlines()] @@ -46,7 +46,7 @@ def get_manifest(repo): return b''.join(new_lines) -def alter_bundle_url(repo, url): +def alter_bundle_url(repo, url: bytes) -> bytes: """a function that exist to help extension and hosting to alter the url This will typically be used to inject authentication information in the url