diff mercurial/wireprotoserver.py @ 36107:957e773614d0

wireprotoserver: rename _client to client (API) This method is called in wireproto.py. It should be part of the public API/interface. .. api:: The ``_client()`` method of the wire protocol handler interface has been renamed to ``client()``. Differential Revision: https://phab.mercurial-scm.org/D2084
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 07 Feb 2018 20:24:22 -0800
parents 56fe8a3b2d52
children 90ca4986616c
line wrap: on
line diff
--- a/mercurial/wireprotoserver.py	Wed Feb 07 20:20:11 2018 -0800
+++ b/mercurial/wireprotoserver.py	Wed Feb 07 20:24:22 2018 -0800
@@ -88,6 +88,10 @@
         won't be captured.
         """
 
+    @abc.abstractmethod
+    def client(self):
+        """Returns a string representation of this client (as bytes)."""
+
 def decodevaluefromheaders(req, headerprefix):
     """Decode a long value from multiple HTTP request headers.
 
@@ -164,7 +168,7 @@
             self._ui.fout = oldout
             self._ui.ferr = olderr
 
-    def _client(self):
+    def client(self):
         return 'remote:%s:%s:%s' % (
             self._req.env.get('wsgi.url_scheme') or 'http',
             urlreq.quote(self._req.env.get('REMOTE_HOST', '')),
@@ -399,7 +403,7 @@
     def mayberedirectstdio(self):
         yield None
 
-    def _client(self):
+    def client(self):
         client = encoding.environ.get('SSH_CLIENT', '').split(' ', 1)[0]
         return 'remote:ssh:' + client