comparison mercurial/sshpeer.py @ 52521:b52f2b365eff

typing: add type hints to `ipeercapabilities.capabilities()`
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 16 Dec 2024 03:04:44 -0500
parents 1554bd50a1af
children 24ee91ba9aa8
comparison
equal deleted inserted replaced
52520:1554bd50a1af 52521:b52f2b365eff
6 # GNU General Public License version 2 or any later version. 6 # GNU General Public License version 2 or any later version.
7 7
8 from __future__ import annotations 8 from __future__ import annotations
9 9
10 import re 10 import re
11 import typing
11 import uuid 12 import uuid
12 13
13 from .i18n import _ 14 from .i18n import _
14 from . import ( 15 from . import (
15 error, 16 error,
22 from .utils import ( 23 from .utils import (
23 procutil, 24 procutil,
24 stringutil, 25 stringutil,
25 urlutil, 26 urlutil,
26 ) 27 )
28
29 if typing.TYPE_CHECKING:
30 from typing import (
31 Set,
32 )
27 33
28 34
29 def _serverquote(s): 35 def _serverquote(s):
30 """quote a string for the remote shell ... which we assume is sh""" 36 """quote a string for the remote shell ... which we assume is sh"""
31 if not s: 37 if not s:
439 445
440 # End of ipeerconnection interface. 446 # End of ipeerconnection interface.
441 447
442 # Begin of ipeercapabilities interface. 448 # Begin of ipeercapabilities interface.
443 449
444 def capabilities(self): 450 def capabilities(self) -> Set[bytes]:
445 return self._caps 451 return self._caps
446 452
447 # End of ipeercapabilities interface. 453 # End of ipeercapabilities interface.
448 454
449 def _readerr(self): 455 def _readerr(self):