diff mercurial/streamclone.py @ 52709:279e217d6041

typing: lock in the new type annotations detected with the pyupgrade changes After the changes culminating in 70a75d379daf, pytype was able to detect these types better (typically changing from something like `Generator[Any, Any, None]` to `Generator[bytes, Any, None]`). Let's make these explicit so they don't disappear because of other changes.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 06 Jan 2025 20:02:17 -0500
parents e627cc25b6f3
children f5471af96a52
line wrap: on
line diff
--- a/mercurial/streamclone.py	Wed Jan 15 06:56:44 2025 +0100
+++ b/mercurial/streamclone.py	Mon Jan 06 20:02:17 2025 -0500
@@ -12,7 +12,7 @@
 import os
 import struct
 
-from typing import Optional
+from typing import Iterator, Optional
 
 from .i18n import _
 from .interfaces import repository
@@ -308,7 +308,7 @@
     return len(entries), total_bytes, emitrevlogdata()
 
 
-def generatev1wireproto(repo):
+def generatev1wireproto(repo) -> Iterator[bytes]:
     """Emit content for version 1 of streaming clone suitable for the wire.
 
     This is the data output from ``generatev1()`` with 2 header lines. The