typing: add some trivial type hints to `mercurial/bundlecaches.py`
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 10 Jul 2024 17:16:19 -0400
changeset 51672 138ab7c6a6ff
parent 51671 6fc31e7bd5db
child 51673 f70f61a8c5bc
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.
mercurial/bundlecaches.py
--- a/mercurial/bundlecaches.py	Wed Jul 10 17:09:34 2024 -0400
+++ b/mercurial/bundlecaches.py	Wed Jul 10 17:16:19 2024 -0400
@@ -30,7 +30,7 @@
 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 @@
     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