mercurial/help/internals/wireprotocolv2.txt
author Gregory Szorc <gregory.szorc@gmail.com>
Wed, 05 Sep 2018 09:09:52 -0700
changeset 39637 c7a7c7e844e5
parent 39634 9dffa99f9158
child 39639 0e03e6a44dee
permissions -rw-r--r--
wireprotov2: define and implement "manifestdata" command The added command can be used for obtaining manifest data. Given a manifest path and set of manifest nodes, data about manifests can be retrieved. Unlike changeset data, we wish to emit deltas to describe manifest revisions. So the command uses the relatively new API for building delta requests and emitting them. The code calls into deltaparent(), which I'm not very keen of. There's still work to be done in delta generation land so implementation details of storage (e.g. exactly one delta is stored/available) don't creep into higher levels. But we can worry about this later (there is already a TODO on imanifestorage tracking this). On the subject of parent deltas, the server assumes parent revisions exist on the receiving end. This is obviously wrong for shallow clone. I've added TODOs to add a mechanism to the command to allow clients to specify desired behavior. This shouldn't be too difficult to implement. Another big change is that the client must explicitly request manifest nodes to retrieve. This is a major departure from "getbundle," where the server derives relevant manifests as it iterates changesets and sends them automatically. As implemented, the client must transmit each requested node to the server. At 20 bytes per node, we're looking at 2 MB per 100,000 nodes. Plus wire encoding overhead. This isn't ideal for clients with limited upload bandwidth. I plan to address this in the future by allowing alternate mechanisms for defining the revisions to retrieve. One idea is to define a range of changeset revisions whose manifest revisions to retrieve (similar to how "changesetdata" works). We almost certainly want an API to look up an individual manifest by node. And that's where I've chosen to start with the implementation. Again, a theme of this early exchangev2 work is I want to start by building primitives for accessing raw repository data first and see how far we can get with those before we need more complexity. Differential Revision: https://phab.mercurial-scm.org/D4488
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37485
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
     1
**Experimental and under active development**
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
     2
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
     3
This section documents the wire protocol commands exposed to transports
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
     4
using the frame-based protocol. The set of commands exposed through
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
     5
these transports is distinct from the set of commands exposed to legacy
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
     6
transports.
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
     7
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
     8
The frame-based protocol uses CBOR to encode command execution requests.
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
     9
All command arguments must be mapped to a specific or set of CBOR data
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
    10
types.
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
    11
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
    12
The response to many commands is also CBOR. There is no common response
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
    13
format: each command defines its own response format.
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
    14
39439
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    15
TODOs
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    16
=====
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    17
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    18
* Add "node namespace" support to each command. In order to support
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    19
  SHA-1 hash transition, we want servers to be able to expose different
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    20
  "node namespaces" for the same data. Every command operating on nodes
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    21
  should specify which "node namespace" it is operating on and responses
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    22
  should encode the "node namespace" accordingly.
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    23
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    24
Commands
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    25
========
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    26
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    27
The sections below detail all commands available to wire protocol version
dc61a67c1fc0 internals: extract wire protocol version 2 commands to standalone doc
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37726
diff changeset
    28
2.
37485
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
    29
37488
3b99eb028859 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    30
branchmap
3b99eb028859 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    31
---------
3b99eb028859 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    32
3b99eb028859 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    33
Obtain heads in named branches.
3b99eb028859 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    34
3b99eb028859 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    35
Receives no arguments.
3b99eb028859 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    36
3b99eb028859 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    37
The response is a map with bytestring keys defining the branch name.
3b99eb028859 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    38
Values are arrays of bytestring defining raw changeset nodes.
3b99eb028859 wireproto: port branchmap to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    39
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    40
capabilities
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    41
------------
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    42
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    43
Obtain the server's capabilities.
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    44
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    45
Receives no arguments.
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    46
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    47
This command is typically called only as part of the handshake during
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    48
initial connection establishment.
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    49
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    50
The response is a map with bytestring keys defining server information.
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    51
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    52
The defined keys are:
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    53
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    54
commands
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    55
   A map defining available wire protocol commands on this server.
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    56
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    57
   Keys in the map are the names of commands that can be invoked. Values
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    58
   are maps defining information about that command. The bytestring keys
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    59
   are:
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    60
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    61
      args
37535
69e46c1834ac wireproto: define and expose types of wire command arguments
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37533
diff changeset
    62
         A map of argument names and their expected types.
69e46c1834ac wireproto: define and expose types of wire command arguments
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37533
diff changeset
    63
69e46c1834ac wireproto: define and expose types of wire command arguments
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37533
diff changeset
    64
         Types are defined as a representative value for the expected type.
69e46c1834ac wireproto: define and expose types of wire command arguments
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37533
diff changeset
    65
         e.g. an argument expecting a boolean type will have its value
69e46c1834ac wireproto: define and expose types of wire command arguments
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37533
diff changeset
    66
         set to true. An integer type will have its value set to 42. The
69e46c1834ac wireproto: define and expose types of wire command arguments
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37533
diff changeset
    67
         actual values are arbitrary and may not have meaning.
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    68
      permissions
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    69
         An array of permissions required to execute this command.
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    70
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    71
compression
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    72
   An array of maps defining available compression format support.
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    73
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    74
   The array is sorted from most preferred to least preferred.
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    75
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    76
   Each entry has the following bytestring keys:
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    77
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    78
      name
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    79
         Name of the compression engine. e.g. ``zstd`` or ``zlib``.
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    80
37653
b2fa1591fb44 wireproto: add media type to version 2 capabilities response
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
    81
framingmediatypes
b2fa1591fb44 wireproto: add media type to version 2 capabilities response
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
    82
   An array of bytestrings defining the supported framing protocol
b2fa1591fb44 wireproto: add media type to version 2 capabilities response
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
    83
   media types. Servers will not accept media types not in this list.
b2fa1591fb44 wireproto: add media type to version 2 capabilities response
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
    84
37657
23c4ddda7bbe wireproto: expose repository formats via capabilities
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37653
diff changeset
    85
rawrepoformats
23c4ddda7bbe wireproto: expose repository formats via capabilities
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37653
diff changeset
    86
   An array of storage formats the repository is using. This set of
23c4ddda7bbe wireproto: expose repository formats via capabilities
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37653
diff changeset
    87
   requirements can be used to determine whether a client can read a
23c4ddda7bbe wireproto: expose repository formats via capabilities
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37653
diff changeset
    88
   *raw* copy of file data available.
23c4ddda7bbe wireproto: expose repository formats via capabilities
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37653
diff changeset
    89
39630
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
    90
changesetdata
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
    91
-------------
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
    92
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
    93
Obtain various data related to changesets.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
    94
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
    95
The command accepts the following arguments:
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
    96
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
    97
noderange
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
    98
   (array of arrays of bytestrings) An array of 2 elements, each being an
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
    99
   array of node bytestrings. The first array denotes the changelog revisions
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   100
   that are already known to the client. The second array denotes the changelog
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   101
   revision DAG heads to fetch. The argument essentially defines a DAG range
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   102
   bounded by root and head nodes to fetch.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   103
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   104
   The roots array may be empty. The heads array must be defined.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   105
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   106
nodes
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   107
   (array of bytestrings) Changelog revisions to request explicitly.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   108
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   109
fields
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   110
   (set of bytestring) Which data associated with changelog revisions to
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   111
   fetch. The following values are recognized:
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   112
39634
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39632
diff changeset
   113
   bookmarks
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39632
diff changeset
   114
      Bookmarks associated with a revision.
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39632
diff changeset
   115
39630
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   116
   parents
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   117
      Parent revisions.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   118
39632
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   119
   phase
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   120
      The phase state of a revision.
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   121
39630
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   122
   revision
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   123
      The raw, revision data for the changelog entry. The hash of this data
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   124
      will match the revision's node value.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   125
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   126
The server resolves the set of revisions relevant to the request by taking
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   127
the union of the ``noderange`` and ``nodes`` arguments. At least one of these
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   128
arguments must be defined.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   129
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   130
The response bytestream starts with a CBOR map describing the data that follows.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   131
This map has the following bytestring keys:
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   132
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   133
totalitems
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   134
   (unsigned integer) Total number of changelog revisions whose data is being
39632
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   135
   transferred. This maps to the set of revisions in the requested node
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   136
   range, not the total number of records that follow (see below for why).
39630
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   137
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   138
Following the map header is a series of 0 or more CBOR values. If values
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   139
are present, the first value will always be a map describing a single changeset
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   140
revision. If revision data is requested, the raw revision data (encoded as
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   141
a CBOR bytestring) will follow the map describing it. Otherwise, another CBOR
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   142
map describing the next changeset revision will occur.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   143
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   144
Each map has the following bytestring keys:
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   145
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   146
node
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   147
   (bytestring) The node value for this revision. This is the SHA-1 hash of
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   148
   the raw revision data.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   149
39634
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39632
diff changeset
   150
bookmarks (optional)
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39632
diff changeset
   151
   (array of bytestrings) Bookmarks attached to this revision. Only present
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39632
diff changeset
   152
   if ``bookmarks`` data is being requested and the revision has bookmarks
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39632
diff changeset
   153
   attached.
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39632
diff changeset
   154
39630
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   155
parents (optional)
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   156
   (array of bytestrings) The nodes representing the parent revisions of this
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   157
   revision. Only present if ``parents`` data is being requested.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   158
39632
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   159
phase (optional)
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   160
   (bytestring) The phase that a revision is in. Recognized values are
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   161
   ``secret``, ``draft``, and ``public``. Only present if ``phase`` data
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   162
   is being requested.
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   163
39630
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   164
revisionsize (optional)
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   165
   (unsigned integer) Indicates the size of raw revision data that follows this
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   166
   map. The following data contains a serialized form of the changeset data,
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   167
   including the author, date, commit message, set of changed files, manifest
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   168
   node, and other metadata.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   169
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   170
   Only present if ``revision`` data was requested and the data follows this
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   171
   map.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   172
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   173
If nodes are requested via ``noderange``, they will be emitted in DAG order,
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   174
parents always before children.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   175
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   176
If nodes are requested via ``nodes``, they will be emitted in requested order.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   177
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   178
Nodes from ``nodes`` are emitted before nodes from ``noderange``.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   179
39632
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   180
The set of changeset revisions emitted may not match the exact set of
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   181
changesets requested. Furthermore, the set of keys present on each
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   182
map may vary. This is to facilitate emitting changeset updates as well
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   183
as new revisions.
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   184
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   185
For example, if the request wants ``phase`` and ``revision`` data,
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   186
the response may contain entries for each changeset in the common nodes
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   187
set with the ``phase`` key and without the ``revision`` key in order
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   188
to reflect a phase-only update.
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39630
diff changeset
   189
39630
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   190
TODO support different revision selection mechanisms (e.g. non-public, specific
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   191
revisions)
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   192
TODO support different hash "namespaces" for revisions (e.g. sha-1 versus other)
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   193
TODO support emitting obsolescence data
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   194
TODO support filtering based on relevant paths (narrow clone)
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   195
TODO support depth limiting
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   196
TODO support hgtagsfnodes cache / tags data
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   197
TODO support branch heads cache
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39461
diff changeset
   198
37485
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   199
heads
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   200
-----
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   201
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   202
Obtain DAG heads in the repository.
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   203
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   204
The command accepts the following arguments:
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   205
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   206
publiconly (optional)
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   207
   (boolean) If set, operate on the DAG for public phase changesets only.
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   208
   Non-public (i.e. draft) phase DAG heads will not be returned.
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   209
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   210
The response is a CBOR array of bytestrings defining changeset nodes
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   211
of DAG heads. The array can be empty if the repository is empty or no
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   212
changesets satisfied the request.
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   213
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   214
TODO consider exposing phase of heads in response
37486
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   215
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   216
known
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   217
-----
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   218
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   219
Determine whether a series of changeset nodes is known to the server.
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   220
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   221
The command accepts the following arguments:
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   222
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   223
nodes
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   224
   (array of bytestrings) List of changeset nodes whose presence to
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   225
   query.
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   226
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   227
The response is a bytestring where each byte contains a 0 or 1 for the
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   228
corresponding requested node at the same index.
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   229
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   230
TODO use a bit array for even more compact response
37487
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   231
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   232
listkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   233
--------
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   234
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   235
List values in a specified ``pushkey`` namespace.
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   236
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   237
The command receives the following arguments:
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   238
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   239
namespace
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   240
   (bytestring) Pushkey namespace to query.
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   241
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   242
The response is a map with bytestring keys and values.
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   243
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   244
TODO consider using binary to represent nodes in certain pushkey namespaces.
37537
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   245
37538
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   246
lookup
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   247
------
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   248
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   249
Try to resolve a value to a changeset revision.
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   250
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   251
Unlike ``known`` which operates on changeset nodes, lookup operates on
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   252
node fragments and other names that a user may use.
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   253
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   254
The command receives the following arguments:
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   255
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   256
key
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   257
   (bytestring) Value to try to resolve.
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   258
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   259
On success, returns a bytestring containing the resolved node.
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   260
39637
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   261
manifestdata
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   262
------------
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   263
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   264
Obtain various data related to manifests (which are lists of files in
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   265
a revision).
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   266
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   267
The command accepts the following arguments:
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   268
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   269
fields
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   270
   (set of bytestring) Which data associated with manifests to fetch.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   271
   The following values are recognized:
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   272
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   273
   parents
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   274
      Parent nodes for the manifest.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   275
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   276
   revision
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   277
      The raw revision data for the manifest.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   278
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   279
nodes
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   280
   (array of bytestring) Manifest nodes whose data to retrieve.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   281
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   282
tree
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   283
   (bytestring) Path to manifest to retrieve. The empty bytestring represents
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   284
   the root manifest. All other values represent directories/trees within
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   285
   the repository.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   286
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   287
TODO allow specifying revisions via alternate means (such as from changeset
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   288
revisions or ranges)
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   289
TODO consider recursive expansion of manifests (with path filtering for
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   290
narrow use cases)
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   291
TODO more control over whether to emit fulltexts or deltas
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   292
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   293
The response bytestream starts with a CBOR map describing the data that
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   294
follows. It has the following bytestring keys:
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   295
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   296
totalitems
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   297
   (unsigned integer) Total number of manifest revisions whose data is
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   298
   being returned.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   299
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   300
Following the header map is a series of 0 or more CBOR values. The first
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   301
value is always a map describing a manifest revision. If this map has the
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   302
``deltasize`` or ``revisionsize`` keys, a bytestring containing the delta
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   303
or revision, respectively, will immediately follow the map. Otherwise
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   304
the next value will be a map describing the next manifest revision.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   305
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   306
Each map has the following bytestring keys:
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   307
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   308
node
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   309
   (bytestring) The node of the manifest revision whose data is represented.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   310
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   311
deltabasenode
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   312
   (bytestring) The node that the delta representation of this revision is
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   313
   computed against. Only present if the ``revision`` field is requested and
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   314
   a delta is being emitted.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   315
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   316
deltasize
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   317
   (unsigned integer) The size of the delta data that follows this map.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   318
   Only present if the ``revision`` field is requested and a delta is
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   319
   being emitted.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   320
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   321
parents
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   322
   (array of bytestring) The nodes of the parents of this manifest revision.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   323
   Only present if the ``parents`` field is requested.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   324
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   325
revisionsize
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   326
   (unsigned integer) The size of the fulltext revision data that follows
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   327
   this map. Only present if the ``revision`` field is requested and a fulltext
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   328
   revision is being emitted.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   329
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   330
When ``revision`` data is requested, the server chooses to emit either fulltext
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   331
revision data or a delta. What the server decides can be inferred by looking
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   332
for the presence of the ``deltasize`` or ``revisionsize`` keys in the map.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   333
Servers MUST NOT define both keys.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39634
diff changeset
   334
37537
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   335
pushkey
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   336
-------
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   337
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   338
Set a value using the ``pushkey`` protocol.
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   339
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   340
The command receives the following arguments:
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   341
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   342
namespace
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   343
   (bytestring) Pushkey namespace to operate on.
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   344
key
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   345
   (bytestring) The pushkey key to set.
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   346
old
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   347
   (bytestring) Old value for this key.
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   348
new
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   349
   (bytestring) New value for this key.
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   350
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   351
TODO consider using binary to represent nodes is certain pushkey namespaces.
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   352
TODO better define response type and meaning.