changeset 51672:138ab7c6a6ff

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.
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 10 Jul 2024 17:16:19 -0400
parents 6fc31e7bd5db
children f70f61a8c5bc
files mercurial/bundlecaches.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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