changeset 20904:3dbe6bcd7f62

wireproto: document protocol specific function of wirepeer Those function are explicitly declared and documented now.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 28 Mar 2014 12:29:34 -0700
parents 8d477543882b
children 167047ba3cfa
files mercurial/wireproto.py
diffstat 1 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/wireproto.py	Fri Mar 28 11:10:33 2014 -0700
+++ b/mercurial/wireproto.py	Fri Mar 28 12:29:34 2014 -0700
@@ -372,6 +372,44 @@
             opts['four'] = four
         return self._call('debugwireargs', one=one, two=two, **opts)
 
+    def _call(self, cmd, **args):
+        """execute <cmd> on the server
+
+        The command is expected to return a simple string.
+
+        returns the server reply as a string."""
+        raise NotImplementedError()
+
+    def _callstream(self, cmd, **args):
+        """execute <cmd> on the server
+
+        The command is expected to return a stream.
+
+        returns the server reply as a file like object."""
+        raise NotImplementedError()
+
+    def _callpush(self, cmd, fp, **args):
+        """execute a <cmd> on server
+
+        The command is expected to be related to a push. Push has a special
+        return method.
+
+        returns the server reply as a (ret, output) tuple. ret is either
+        empty (error) or a stringified int.
+        """
+        raise NotImplementedError()
+
+    def _abort(self, exception):
+        """clearly abort the wire protocol connection and raise the exception
+        """
+        raise NotImplementedError()
+
+
+    def _decompress(self, stream):
+        """decompress a received stream
+        """
+        raise NotImplementedError()
+
 # server side
 
 # wire protocol command can either return a string or one of these classes.