mercurial/interfaces/repository.py
changeset 52520 1554bd50a1af
parent 52518 5a924cb07768
child 52521 b52f2b365eff
--- a/mercurial/interfaces/repository.py	Mon Dec 16 02:10:46 2024 -0500
+++ b/mercurial/interfaces/repository.py	Mon Dec 16 02:41:24 2024 -0500
@@ -205,6 +205,13 @@
         """
 
     @abc.abstractmethod
+    def capabilities(self):
+        """Obtain capabilities of the peer.
+
+        Returns a set of string capabilities.
+        """
+
+    @abc.abstractmethod
     def requirecap(self, name: bytes, purpose: bytes) -> None:
         """Require a capability to be present.
 
@@ -228,13 +235,6 @@
         """
 
     @abc.abstractmethod
-    def capabilities(self):
-        """Obtain capabilities of the peer.
-
-        Returns a set of string capabilities.
-        """
-
-    @abc.abstractmethod
     def get_cached_bundle_inline(self, path):
         """Retrieve a clonebundle across the wire.
 
@@ -470,9 +470,7 @@
         self.path = path
 
     def capable(self, name: bytes) -> bool | bytes:
-        # TODO: this class should maybe subclass ipeercommands too, otherwise it
-        #  is assuming whatever uses this as a mixin also has this interface.
-        caps = self.capabilities()  # pytype: disable=attribute-error
+        caps = self.capabilities()
         if name in caps:
             return True