wireprotov2: change frame type value for command data
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 14 Apr 2018 12:11:24 -0700
changeset 37723 e8fba6d578f0
parent 37722 89a16704114c
child 37724 deff7cf7eefd
wireprotov2: change frame type value for command data When we dropped the dedicated command argument frame type, this left a hole in our frame type numbering. Let's start plugging that hole. The command data frame is now type value 2 instead of 3. There was limited test fallout because a) we do a good job of using the constants to refer to frame types b) not many tests are sending command data frames. Bumping the media type will be performed in a later commit, once all type value adjustment has been performed. Differential Revision: https://phab.mercurial-scm.org/D3383
mercurial/help/internals/wireprotocol.txt
mercurial/wireprotoframing.py
tests/test-wireproto-serverreactor.py
--- a/mercurial/help/internals/wireprotocol.txt	Sat Apr 14 12:07:31 2018 -0700
+++ b/mercurial/help/internals/wireprotocol.txt	Sat Apr 14 12:11:24 2018 -0700
@@ -638,10 +638,10 @@
 ``0x01`` or ``0x02`` MUST be set to indicate this frame's role in
 a series of command request frames.
 
-If command data frames are to be sent, ``0x10`` MUST be set on ALL
+If command data frames are to be sent, ``0x08`` MUST be set on ALL
 command request frames.
 
-Command Data (``0x03``)
+Command Data (``0x02``)
 -----------------------
 
 This frame contains raw data for a command.
--- a/mercurial/wireprotoframing.py	Sat Apr 14 12:07:31 2018 -0700
+++ b/mercurial/wireprotoframing.py	Sat Apr 14 12:11:24 2018 -0700
@@ -42,7 +42,7 @@
 }
 
 FRAME_TYPE_COMMAND_REQUEST = 0x01
-FRAME_TYPE_COMMAND_DATA = 0x03
+FRAME_TYPE_COMMAND_DATA = 0x02
 FRAME_TYPE_BYTES_RESPONSE = 0x04
 FRAME_TYPE_ERROR_RESPONSE = 0x05
 FRAME_TYPE_TEXT_OUTPUT = 0x06
--- a/tests/test-wireproto-serverreactor.py	Sat Apr 14 12:07:31 2018 -0700
+++ b/tests/test-wireproto-serverreactor.py	Sat Apr 14 12:11:24 2018 -0700
@@ -185,7 +185,7 @@
             ffs(b'1 1 stream-begin command-data 0 ignored'))
         self.assertaction(result, b'error')
         self.assertEqual(result[1], {
-            b'message': b'expected command request frame; got 3',
+            b'message': b'expected command request frame; got 2',
         })
 
     def testunexpectedcommanddatareceiving(self):