Show More
@@ -8,7 +8,10 | |||||
8 |
|
8 | |||
9 | from __future__ import annotations |
|
9 | from __future__ import annotations | |
10 |
|
10 | |||
|
11 | import typing | |||
|
12 | ||||
11 | from typing import ( |
|
13 | from typing import ( | |
|
14 | Any, | |||
12 | Protocol, |
|
15 | Protocol, | |
13 | ) |
|
16 | ) | |
14 |
|
17 | |||
@@ -16,6 +19,17 from ..i18n import _ | |||||
16 | from .. import error |
|
19 | from .. import error | |
17 | from . import util as interfaceutil |
|
20 | from . import util as interfaceutil | |
18 |
|
21 | |||
|
22 | if typing.TYPE_CHECKING: | |||
|
23 | # Almost all mercurial modules are only imported in the type checking phase | |||
|
24 | # to avoid circular imports | |||
|
25 | from ..utils import ( | |||
|
26 | urlutil, | |||
|
27 | ) | |||
|
28 | ||||
|
29 | # TODO: create a Protocol class, since importing uimod here causes a cycle | |||
|
30 | # that confuses pytype. | |||
|
31 | Ui = Any | |||
|
32 | ||||
19 | # Local repository feature string. |
|
33 | # Local repository feature string. | |
20 |
|
34 | |||
21 | # Revlogs are being used for file storage. |
|
35 | # Revlogs are being used for file storage. | |
@@ -112,8 +126,11 class ipeerconnection(Protocol): | |||||
112 | outside of this module. |
|
126 | outside of this module. | |
113 | """ |
|
127 | """ | |
114 |
|
128 | |||
115 | ui = interfaceutil.Attribute("""ui.ui instance""") |
|
129 | ui: Ui | |
116 | path = interfaceutil.Attribute("""a urlutil.path instance or None""") |
|
130 | """ui.ui instance""" | |
|
131 | ||||
|
132 | path: urlutil.path | None | |||
|
133 | """a urlutil.path instance or None""" | |||
117 |
|
134 | |||
118 | def url(self): |
|
135 | def url(self): | |
119 | """Returns a URL string representing this peer. |
|
136 | """Returns a URL string representing this peer. |
General Comments 0
You need to be logged in to leave comments.
Login now