diff mercurial/help/internals/wireprotocolv2.txt @ 40172:30f70d11c224

wireprotov2: advertise recommended batch size for requests Currently, exchangev2 hardcodes the batch size for how many revisions to fetch per command request. A single value is not appropriate for every repository because some repositories may have a drastically different "shape" from other repositories. e.g. a repo with lots of small files may benefit from larger batch sizes than a repo with lots of large files. And depending on caching used by the server, the server may wish to control the number of commands (to e.g. mitigate overhead of following content redirects). This commit teaches wireprotov2 commands to declare extra metadata which is advertised as part of the command descriptor. The manifestdata command has been taught to advertise a recommended batch size for requests. Differential Revision: https://phab.mercurial-scm.org/D4975
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 08 Oct 2018 17:45:51 -0700
parents 9b19b8ce3804
children 41263df08109
line wrap: on
line diff
--- a/mercurial/help/internals/wireprotocolv2.txt	Wed Oct 03 13:07:28 2018 -0700
+++ b/mercurial/help/internals/wireprotocolv2.txt	Mon Oct 08 17:45:51 2018 -0700
@@ -87,6 +87,10 @@
       permissions
          An array of permissions required to execute this command.
 
+      *
+         (various) Individual commands may define extra keys that supplement
+         generic command metadata. See the command definition for more.
+
 framingmediatypes
    An array of bytestrings defining the supported framing protocol
    media types. Servers will not accept media types not in this list.
@@ -509,6 +513,15 @@
 revision data or a delta. What the server decides can be inferred by looking
 for the presence of ``delta`` or ``revision`` in the ``fieldsfollowing`` array.
 
+Servers MAY advertise the following extra fields in the capabilities
+descriptor for this command:
+
+recommendedbatchsize
+   (unsigned integer) Number of revisions the server recommends as a batch
+   query size. If defined, clients needing to issue multiple ``manifestdata``
+   commands to obtain needed data SHOULD construct their commands to have
+   this many revisions per request.
+
 pushkey
 -------