##// END OF EJS Templates
repository: split capabilities methods into separate interface...
Gregory Szorc -
r37628:98861a22 default
parent child Browse files
Show More
@@ -61,6 +61,26 b' class ipeerconnection(zi.Interface):'
61 associated with the peer should be cleaned up.
61 associated with the peer should be cleaned up.
62 """
62 """
63
63
64 class ipeercapabilities(zi.Interface):
65 """Peer sub-interface related to capabilities."""
66
67 def capable(name):
68 """Determine support for a named capability.
69
70 Returns ``False`` if capability not supported.
71
72 Returns ``True`` if boolean capability is supported. Returns a string
73 if capability support is non-boolean.
74
75 Capability strings may or may not map to wire protocol capabilities.
76 """
77
78 def requirecap(name, purpose):
79 """Require a capability to be present.
80
81 Raises a ``CapabilityError`` if the capability isn't present.
82 """
83
64 class ipeercommands(zi.Interface):
84 class ipeercommands(zi.Interface):
65 """Client-side interface for communicating over the wire protocol.
85 """Client-side interface for communicating over the wire protocol.
66
86
@@ -176,7 +196,7 b' class ipeerlegacycommands(zi.Interface):'
176 def changegroupsubset(bases, heads, kind):
196 def changegroupsubset(bases, heads, kind):
177 pass
197 pass
178
198
179 class ipeerbase(ipeerconnection, ipeercommands):
199 class ipeerbase(ipeerconnection, ipeercapabilities, ipeercommands):
180 """Unified interface for peer repositories.
200 """Unified interface for peer repositories.
181
201
182 All peer instances must conform to this interface.
202 All peer instances must conform to this interface.
@@ -205,21 +225,6 b' class ipeerbase(ipeerconnection, ipeerco'
205 calls. However, they must all support this API.
225 calls. However, they must all support this API.
206 """
226 """
207
227
208 def capable(name):
209 """Determine support for a named capability.
210
211 Returns ``False`` if capability not supported.
212
213 Returns ``True`` if boolean capability is supported. Returns a string
214 if capability support is non-boolean.
215 """
216
217 def requirecap(name, purpose):
218 """Require a capability to be present.
219
220 Raises a ``CapabilityError`` if the capability isn't present.
221 """
222
223 class ipeerbaselegacycommands(ipeerbase, ipeerlegacycommands):
228 class ipeerbaselegacycommands(ipeerbase, ipeerlegacycommands):
224 """Unified peer interface that supports legacy commands."""
229 """Unified peer interface that supports legacy commands."""
225
230
General Comments 0
You need to be logged in to leave comments. Login now