D3384: wireprotov2: change frame type and name for command response

2018-04-16 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdeff7cf7eefd: wireprotov2: change frame type and name for 
command response (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3384?vs=8296=8327

REVISION DETAIL
  https://phab.mercurial-scm.org/D3384

AFFECTED FILES
  mercurial/help/internals/wireprotocol.txt
  mercurial/wireprotoframing.py
  mercurial/wireprotov2server.py
  tests/test-http-api-httpv2.t
  tests/test-http-protocol.t
  tests/test-wireproto-clientreactor.py
  tests/test-wireproto-command-branchmap.t
  tests/test-wireproto-command-capabilities.t
  tests/test-wireproto-command-heads.t
  tests/test-wireproto-command-known.t
  tests/test-wireproto-command-listkeys.t
  tests/test-wireproto-command-lookup.t
  tests/test-wireproto-command-pushkey.t
  tests/test-wireproto-serverreactor.py

CHANGE DETAILS

diff --git a/tests/test-wireproto-serverreactor.py 
b/tests/test-wireproto-serverreactor.py
--- a/tests/test-wireproto-serverreactor.py
+++ b/tests/test-wireproto-serverreactor.py
@@ -211,19 +211,19 @@
 results.append(self._sendsingleframe(
 reactor, ffs(b'1 1 stream-begin command-request new '
  b"cbor:{b'name': b'command'}")))
-result = reactor.onbytesresponseready(outstream, 1, b'response1')
+result = reactor.oncommandresponseready(outstream, 1, b'response1')
 self.assertaction(result, b'sendframes')
 list(result[1][b'framegen'])
 results.append(self._sendsingleframe(
 reactor, ffs(b'1 1 stream-begin command-request new '
  b"cbor:{b'name': b'command'}")))
-result = reactor.onbytesresponseready(outstream, 1, b'response2')
+result = reactor.oncommandresponseready(outstream, 1, b'response2')
 self.assertaction(result, b'sendframes')
 list(result[1][b'framegen'])
 results.append(self._sendsingleframe(
 reactor, ffs(b'1 1 stream-begin command-request new '
  b"cbor:{b'name': b'command'}")))
-result = reactor.onbytesresponseready(outstream, 1, b'response3')
+result = reactor.oncommandresponseready(outstream, 1, b'response3')
 self.assertaction(result, b'sendframes')
 list(result[1][b'framegen'])
 
@@ -347,10 +347,10 @@
 list(sendcommandframes(reactor, instream, 1, b'mycommand', {}))
 
 outstream = reactor.makeoutputstream()
-result = reactor.onbytesresponseready(outstream, 1, b'response')
+result = reactor.oncommandresponseready(outstream, 1, b'response')
 self.assertaction(result, b'sendframes')
 self.assertframesequal(result[1][b'framegen'], [
-b'1 2 stream-begin bytes-response eos response',
+b'1 2 stream-begin command-response eos response',
 ])
 
 def testmultiframeresponse(self):
@@ -363,11 +363,11 @@
 list(sendcommandframes(reactor, instream, 1, b'mycommand', {}))
 
 outstream = reactor.makeoutputstream()
-result = reactor.onbytesresponseready(outstream, 1, first + second)
+result = reactor.oncommandresponseready(outstream, 1, first + second)
 self.assertaction(result, b'sendframes')
 self.assertframesequal(result[1][b'framegen'], [
-b'1 2 stream-begin bytes-response continuation %s' % first,
-b'1 2 0 bytes-response eos %s' % second,
+b'1 2 stream-begin command-response continuation %s' % first,
+b'1 2 0 command-response eos %s' % second,
 ])
 
 def testapplicationerror(self):
@@ -392,12 +392,12 @@
 self.assertaction(results[0], b'runcommand')
 
 outstream = reactor.makeoutputstream()
-result = reactor.onbytesresponseready(outstream, 1, b'response')
+result = reactor.oncommandresponseready(outstream, 1, b'response')
 self.assertaction(result, b'noop')
 result = reactor.oninputeof()
 self.assertaction(result, b'sendframes')
 self.assertframesequal(result[1][b'framegen'], [
-b'1 2 stream-begin bytes-response eos response',
+b'1 2 stream-begin command-response eos response',
 ])
 
 def testmultiplecommanddeferresponse(self):
@@ -407,15 +407,15 @@
 list(sendcommandframes(reactor, instream, 3, b'command2', {}))
 
 outstream = reactor.makeoutputstream()
-result = reactor.onbytesresponseready(outstream, 1, b'response1')
+result = reactor.oncommandresponseready(outstream, 1, b'response1')
 self.assertaction(result, b'noop')
-result = reactor.onbytesresponseready(outstream, 3, b'response2')
+result = reactor.oncommandresponseready(outstream, 3, b'response2')
 self.assertaction(result, b'noop')
 result = reactor.oninputeof()
 self.assertaction(result, b'sendframes')
 

D3384: wireprotov2: change frame type and name for command response

2018-04-14 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  There was hole at frame type value 3. And the frame is better
  named as a command response.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3384

AFFECTED FILES
  mercurial/help/internals/wireprotocol.txt
  mercurial/wireprotoframing.py
  mercurial/wireprotov2server.py
  tests/test-http-api-httpv2.t
  tests/test-http-protocol.t
  tests/test-wireproto-clientreactor.py
  tests/test-wireproto-command-branchmap.t
  tests/test-wireproto-command-capabilities.t
  tests/test-wireproto-command-heads.t
  tests/test-wireproto-command-known.t
  tests/test-wireproto-command-listkeys.t
  tests/test-wireproto-command-lookup.t
  tests/test-wireproto-command-pushkey.t
  tests/test-wireproto-serverreactor.py

CHANGE DETAILS

diff --git a/tests/test-wireproto-serverreactor.py 
b/tests/test-wireproto-serverreactor.py
--- a/tests/test-wireproto-serverreactor.py
+++ b/tests/test-wireproto-serverreactor.py
@@ -211,19 +211,19 @@
 results.append(self._sendsingleframe(
 reactor, ffs(b'1 1 stream-begin command-request new '
  b"cbor:{b'name': b'command'}")))
-result = reactor.onbytesresponseready(outstream, 1, b'response1')
+result = reactor.oncommandresponseready(outstream, 1, b'response1')
 self.assertaction(result, b'sendframes')
 list(result[1][b'framegen'])
 results.append(self._sendsingleframe(
 reactor, ffs(b'1 1 stream-begin command-request new '
  b"cbor:{b'name': b'command'}")))
-result = reactor.onbytesresponseready(outstream, 1, b'response2')
+result = reactor.oncommandresponseready(outstream, 1, b'response2')
 self.assertaction(result, b'sendframes')
 list(result[1][b'framegen'])
 results.append(self._sendsingleframe(
 reactor, ffs(b'1 1 stream-begin command-request new '
  b"cbor:{b'name': b'command'}")))
-result = reactor.onbytesresponseready(outstream, 1, b'response3')
+result = reactor.oncommandresponseready(outstream, 1, b'response3')
 self.assertaction(result, b'sendframes')
 list(result[1][b'framegen'])
 
@@ -347,10 +347,10 @@
 list(sendcommandframes(reactor, instream, 1, b'mycommand', {}))
 
 outstream = reactor.makeoutputstream()
-result = reactor.onbytesresponseready(outstream, 1, b'response')
+result = reactor.oncommandresponseready(outstream, 1, b'response')
 self.assertaction(result, b'sendframes')
 self.assertframesequal(result[1][b'framegen'], [
-b'1 2 stream-begin bytes-response eos response',
+b'1 2 stream-begin command-response eos response',
 ])
 
 def testmultiframeresponse(self):
@@ -363,11 +363,11 @@
 list(sendcommandframes(reactor, instream, 1, b'mycommand', {}))
 
 outstream = reactor.makeoutputstream()
-result = reactor.onbytesresponseready(outstream, 1, first + second)
+result = reactor.oncommandresponseready(outstream, 1, first + second)
 self.assertaction(result, b'sendframes')
 self.assertframesequal(result[1][b'framegen'], [
-b'1 2 stream-begin bytes-response continuation %s' % first,
-b'1 2 0 bytes-response eos %s' % second,
+b'1 2 stream-begin command-response continuation %s' % first,
+b'1 2 0 command-response eos %s' % second,
 ])
 
 def testapplicationerror(self):
@@ -392,12 +392,12 @@
 self.assertaction(results[0], b'runcommand')
 
 outstream = reactor.makeoutputstream()
-result = reactor.onbytesresponseready(outstream, 1, b'response')
+result = reactor.oncommandresponseready(outstream, 1, b'response')
 self.assertaction(result, b'noop')
 result = reactor.oninputeof()
 self.assertaction(result, b'sendframes')
 self.assertframesequal(result[1][b'framegen'], [
-b'1 2 stream-begin bytes-response eos response',
+b'1 2 stream-begin command-response eos response',
 ])
 
 def testmultiplecommanddeferresponse(self):
@@ -407,15 +407,15 @@
 list(sendcommandframes(reactor, instream, 3, b'command2', {}))
 
 outstream = reactor.makeoutputstream()
-result = reactor.onbytesresponseready(outstream, 1, b'response1')
+result = reactor.oncommandresponseready(outstream, 1, b'response1')
 self.assertaction(result, b'noop')
-result = reactor.onbytesresponseready(outstream, 3, b'response2')
+result = reactor.oncommandresponseready(outstream, 3, b'response2')
 self.assertaction(result, b'noop')
 result = reactor.oninputeof()
 self.assertaction(result, b'sendframes')
 self.assertframesequal(result[1][b'framegen'], [
-b'1 2 stream-begin