Patchwork [03,of,22] wireproto: document protocol specific function of wirepeer

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2014, 10:40 p.m.
Message ID <0bd9c66b3d1184ca318a.1396046429@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4123/
State Accepted
Commit 3dbe6bcd7f624fe017184a388fda1d55417b0590
Headers show

Comments

Pierre-Yves David - March 28, 2014, 10:40 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1396034974 25200
#      Fri Mar 28 12:29:34 2014 -0700
# Node ID 0bd9c66b3d1184ca318a6828d3fa73b8b1373623
# Parent  3047434d86075975df7c6ae430752a6616a8c0bd
wireproto: document protocol specific function of wirepeer

Those function are explicitly declared and documented now.

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -370,10 +370,48 @@  class wirepeer(peer.peerrepository):
             opts['three'] = three
         if four is not None:
             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.
+
+        return server reply as a string."""
+        raise NotImplementedError()
+
+    def _callstream(self, cmd, **args):
+        """execute <cmd> on the server
+
+        The command is expectid to return a stream.
+
+        return 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 having special
+        return method.
+
+        return server reply as (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 this class.
 class streamres(object):
     """wireproto reply: binary stream