Mercurial > hg
comparison mercurial/wireproto.py @ 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 |
comparison
equal
deleted
inserted
replaced
20903:8d477543882b | 20904:3dbe6bcd7f62 |
---|---|
370 opts['three'] = three | 370 opts['three'] = three |
371 if four is not None: | 371 if four is not None: |
372 opts['four'] = four | 372 opts['four'] = four |
373 return self._call('debugwireargs', one=one, two=two, **opts) | 373 return self._call('debugwireargs', one=one, two=two, **opts) |
374 | 374 |
375 def _call(self, cmd, **args): | |
376 """execute <cmd> on the server | |
377 | |
378 The command is expected to return a simple string. | |
379 | |
380 returns the server reply as a string.""" | |
381 raise NotImplementedError() | |
382 | |
383 def _callstream(self, cmd, **args): | |
384 """execute <cmd> on the server | |
385 | |
386 The command is expected to return a stream. | |
387 | |
388 returns the server reply as a file like object.""" | |
389 raise NotImplementedError() | |
390 | |
391 def _callpush(self, cmd, fp, **args): | |
392 """execute a <cmd> on server | |
393 | |
394 The command is expected to be related to a push. Push has a special | |
395 return method. | |
396 | |
397 returns the server reply as a (ret, output) tuple. ret is either | |
398 empty (error) or a stringified int. | |
399 """ | |
400 raise NotImplementedError() | |
401 | |
402 def _abort(self, exception): | |
403 """clearly abort the wire protocol connection and raise the exception | |
404 """ | |
405 raise NotImplementedError() | |
406 | |
407 | |
408 def _decompress(self, stream): | |
409 """decompress a received stream | |
410 """ | |
411 raise NotImplementedError() | |
412 | |
375 # server side | 413 # server side |
376 | 414 |
377 # wire protocol command can either return a string or one of these classes. | 415 # wire protocol command can either return a string or one of these classes. |
378 class streamres(object): | 416 class streamres(object): |
379 """wireproto reply: binary stream | 417 """wireproto reply: binary stream |