diff mercurial/wireprototypes.py @ 36642:6e585bca962e

wireproto: add transport specific capabilities in the transport We add a method to the protocol handler interface that allows specific implementations to add their own capabilities. The SSH implementation is a no-op. The HTTP implementation adds the HTTP-specific capabilities. The end result is transport specific capabilities now live in the transport code instead of in some generic function in the wireproto module. Differential Revision: https://phab.mercurial-scm.org/D2512
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 27 Feb 2018 16:24:02 -0800
parents abc3b9801563
children 66de4555cefd
line wrap: on
line diff
--- a/mercurial/wireprototypes.py	Tue Feb 27 15:23:04 2018 -0800
+++ b/mercurial/wireprototypes.py	Tue Feb 27 16:24:02 2018 -0800
@@ -137,3 +137,12 @@
     @abc.abstractmethod
     def client(self):
         """Returns a string representation of this client (as bytes)."""
+
+    @abc.abstractmethod
+    def addcapabilities(self, repo, caps):
+        """Adds advertised capabilities specific to this protocol.
+
+        Receives the list of capabilities collected so far.
+
+        Returns a list of capabilities. The passed in argument can be returned.
+        """