mercurial/help/internals/wireprotocolv2.txt
author Matt Harbison <matt_harbison@yahoo.com>
Sat, 29 Sep 2018 20:33:52 -0400
changeset 39914 0f8ff3ff5d5c
parent 39820 d3d333ab167a
child 40023 33eb670e2834
permissions -rw-r--r--
run-tests: flush output stream before prompting to accept changes With py3 on Windows, the prompt to accept changes in an --interactive run wasn't showing up until after the choice was read from stdin.
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
39458
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
39817
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    62
         (map) Describes arguments accepted by the command.
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    63
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    64
         Keys are bytestrings denoting the argument name.
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    65
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    66
         Values are maps describing the argument. The map has the following
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    67
         bytestring keys:
37535
69e46c1834ac wireproto: define and expose types of wire command arguments
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37533
diff changeset
    68
39817
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    69
         default
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    70
            (varied) The default value for this argument if not specified. Only
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    71
            present if ``required`` is not true.
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    72
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    73
         required
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    74
            (boolean) Whether the argument must be specified. Failure to send
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    75
            required arguments will result in an error executing the command.
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    76
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    77
         type
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    78
            (bytestring) The type of the argument. e.g. ``bytes`` or ``bool``.
8e7e822e85ec wireprotov2: expose rich arguments metadata
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39816
diff changeset
    79
39818
c30faea8d02d wireprotov2: advertise set of valid values for requestable fields
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39817
diff changeset
    80
         validvalues
c30faea8d02d wireprotov2: advertise set of valid values for requestable fields
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39817
diff changeset
    81
            (set) Values that are recognized for this argument. Some arguments
c30faea8d02d wireprotov2: advertise set of valid values for requestable fields
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39817
diff changeset
    82
            only allow a fixed set of values to be specified. These arguments
c30faea8d02d wireprotov2: advertise set of valid values for requestable fields
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39817
diff changeset
    83
            may advertise that set in this key. If this set is advertised and
c30faea8d02d wireprotov2: advertise set of valid values for requestable fields
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39817
diff changeset
    84
            a value not in this set is specified, the command should result
c30faea8d02d wireprotov2: advertise set of valid values for requestable fields
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39817
diff changeset
    85
            in error.
c30faea8d02d wireprotov2: advertise set of valid values for requestable fields
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39817
diff changeset
    86
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    87
      permissions
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    88
         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
    89
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    90
compression
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    91
   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
    92
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    93
   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
    94
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    95
   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
    96
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    97
      name
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37498
diff changeset
    98
         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
    99
37653
b2fa1591fb44 wireproto: add media type to version 2 capabilities response
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   100
framingmediatypes
b2fa1591fb44 wireproto: add media type to version 2 capabilities response
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   101
   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
   102
   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
   103
39816
ae20f52437e9 wireprotov2: advertise recognized path filter prefixes
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39657
diff changeset
   104
pathfilterprefixes
ae20f52437e9 wireprotov2: advertise recognized path filter prefixes
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39657
diff changeset
   105
   (set of bytestring) Matcher prefixes that are recognized when performing
ae20f52437e9 wireprotov2: advertise recognized path filter prefixes
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39657
diff changeset
   106
   path filtering. Specifying a path filter whose type/prefix does not
ae20f52437e9 wireprotov2: advertise recognized path filter prefixes
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39657
diff changeset
   107
   match one in this set will likely be rejected by the server.
ae20f52437e9 wireprotov2: advertise recognized path filter prefixes
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39657
diff changeset
   108
37657
23c4ddda7bbe wireproto: expose repository formats via capabilities
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37653
diff changeset
   109
rawrepoformats
23c4ddda7bbe wireproto: expose repository formats via capabilities
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37653
diff changeset
   110
   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
   111
   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
   112
   *raw* copy of file data available.
23c4ddda7bbe wireproto: expose repository formats via capabilities
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37653
diff changeset
   113
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   114
changesetdata
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   115
-------------
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   116
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   117
Obtain various data related to changesets.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   118
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   119
The command accepts the following arguments:
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   120
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   121
noderange
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   122
   (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: 39478
diff changeset
   123
   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: 39478
diff changeset
   124
   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: 39478
diff changeset
   125
   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: 39478
diff changeset
   126
   bounded by root and head nodes to fetch.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   127
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   128
   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: 39478
diff changeset
   129
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   130
nodes
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   131
   (array of bytestrings) Changelog revisions to request explicitly.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   132
39820
d3d333ab167a wireprotov2: teach changesetdata to fetch ancestors until depth
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39819
diff changeset
   133
nodesdepth
d3d333ab167a wireprotov2: teach changesetdata to fetch ancestors until depth
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39819
diff changeset
   134
   (unsigned integer) Number of ancestor revisions of elements in ``nodes``
d3d333ab167a wireprotov2: teach changesetdata to fetch ancestors until depth
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39819
diff changeset
   135
   to also fetch. When defined, for each element in ``nodes``, DAG ancestors
d3d333ab167a wireprotov2: teach changesetdata to fetch ancestors until depth
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39819
diff changeset
   136
   will be walked until at most N total revisions are emitted.
d3d333ab167a wireprotov2: teach changesetdata to fetch ancestors until depth
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39819
diff changeset
   137
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   138
fields
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   139
   (set of bytestring) Which data associated with changelog revisions to
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   140
   fetch. The following values are recognized:
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   141
39650
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39648
diff changeset
   142
   bookmarks
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39648
diff changeset
   143
      Bookmarks associated with a revision.
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39648
diff changeset
   144
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   145
   parents
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   146
      Parent revisions.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   147
39648
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   148
   phase
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   149
      The phase state of a revision.
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   150
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   151
   revision
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   152
      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: 39478
diff changeset
   153
      will match the revision's node value.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   154
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   155
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: 39478
diff changeset
   156
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: 39478
diff changeset
   157
arguments must be defined.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   158
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   159
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: 39478
diff changeset
   160
This map has the following bytestring keys:
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   161
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   162
totalitems
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   163
   (unsigned integer) Total number of changelog revisions whose data is being
39648
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   164
   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: 39646
diff changeset
   165
   range, not the total number of records that follow (see below for why).
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   166
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   167
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: 39478
diff changeset
   168
are present, the first value will always be a map describing a single changeset
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   169
revision.
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   170
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   171
If the ``fieldsfollowing`` key is present, the map will immediately be followed
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   172
by N CBOR bytestring values, where N is the number of elements in
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   173
``fieldsfollowing``. Each bytestring value corresponds to a field denoted
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   174
by ``fieldsfollowing``.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   175
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   176
Following the optional bytestring field values is the next revision descriptor
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   177
map, or end of stream.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   178
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   179
Each revision descriptor map has the following bytestring keys:
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   180
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   181
node
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   182
   (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: 39478
diff changeset
   183
   the raw revision data.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   184
39650
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39648
diff changeset
   185
bookmarks (optional)
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39648
diff changeset
   186
   (array of bytestrings) Bookmarks attached to this revision. Only present
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39648
diff changeset
   187
   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: 39648
diff changeset
   188
   attached.
9dffa99f9158 wireprotov2: add bookmarks to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39648
diff changeset
   189
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   190
fieldsfollowing (optional)
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   191
   (array of 2-array) Denotes what fields immediately follow this map. Each
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   192
   value is an array with 2 elements: the bytestring field name and an unsigned
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   193
   integer describing the length of the data, in bytes.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   194
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   195
   If this key isn't present, no special fields will follow this map.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   196
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   197
   The following fields may be present:
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   198
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   199
   revision
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   200
      Raw, revision data for the changelog entry. Contains a serialized form
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   201
      of the changeset data, including the author, date, commit message, set
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   202
      of changed files, manifest node, and other metadata.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   203
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   204
      Only present if the ``revision`` field was requested.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   205
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   206
parents (optional)
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   207
   (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: 39478
diff changeset
   208
   revision. Only present if ``parents`` data is being requested.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   209
39648
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   210
phase (optional)
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   211
   (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: 39646
diff changeset
   212
   ``secret``, ``draft``, and ``public``. Only present if ``phase`` data
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   213
   is being requested.
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   214
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   215
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: 39478
diff changeset
   216
parents always before children.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   217
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   218
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: 39478
diff changeset
   219
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   220
Nodes from ``nodes`` are emitted before nodes from ``noderange``.
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   221
39648
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   222
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: 39646
diff changeset
   223
changesets requested. Furthermore, the set of keys present on each
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   224
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: 39646
diff changeset
   225
as new revisions.
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   226
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   227
For example, if the request wants ``phase`` and ``revision`` data,
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   228
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: 39646
diff changeset
   229
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: 39646
diff changeset
   230
to reflect a phase-only update.
c1aacb0d76ff wireprotov2: add phases to "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39646
diff changeset
   231
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   232
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: 39478
diff changeset
   233
revisions)
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   234
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: 39478
diff changeset
   235
TODO support emitting obsolescence data
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   236
TODO support filtering based on relevant paths (narrow clone)
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   237
TODO support hgtagsfnodes cache / tags data
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   238
TODO support branch heads cache
39820
d3d333ab167a wireprotov2: teach changesetdata to fetch ancestors until depth
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39819
diff changeset
   239
TODO consider unify query mechanism. e.g. as an array of "query descriptors"
d3d333ab167a wireprotov2: teach changesetdata to fetch ancestors until depth
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39819
diff changeset
   240
rather than a set of top-level arguments that have semantics when combined.
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39478
diff changeset
   241
39655
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   242
filedata
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   243
--------
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   244
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   245
Obtain various data related to an individual tracked file.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   246
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   247
The command accepts the following arguments:
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   248
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   249
fields
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   250
   (set of bytestring) Which data associated with a file to fetch.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   251
   The following values are recognized:
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   252
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   253
   parents
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   254
      Parent nodes for the revision.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   255
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   256
   revision
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   257
      The raw revision data for a file.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   258
39657
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   259
haveparents
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   260
   (bool) Whether the client has the parent revisions of all requested
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   261
   nodes. If set, the server may emit revision data as deltas against
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   262
   any parent revision. If not set, the server MUST only emit deltas for
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   263
   revisions previously emitted by this command.
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   264
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   265
   False is assumed in the absence of any value.
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   266
39655
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   267
nodes
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   268
   (array of bytestrings) File nodes whose data to retrieve.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   269
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   270
path
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   271
   (bytestring) Path of the tracked file whose data to retrieve.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   272
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   273
TODO allow specifying revisions via alternate means (such as from
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   274
changeset revisions or ranges)
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   275
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   276
The response bytestream starts with a CBOR map describing the data that
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   277
follows. It has the following bytestream keys:
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   278
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   279
totalitems
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   280
   (unsigned integer) Total number of file revisions whose data is
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   281
   being returned.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   282
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   283
Following the map header is a series of 0 or more CBOR values. If values
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   284
are present, the first value will always be a map describing a single changeset
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   285
revision.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   286
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   287
If the ``fieldsfollowing`` key is present, the map will immediately be followed
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   288
by N CBOR bytestring values, where N is the number of elements in
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   289
``fieldsfollowing``. Each bytestring value corresponds to a field denoted
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   290
by ``fieldsfollowing``.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   291
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   292
Following the optional bytestring field values is the next revision descriptor
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   293
map, or end of stream.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   294
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   295
Each revision descriptor map has the following bytestring keys:
39655
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   296
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   297
Each map has the following bytestring keys:
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   298
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   299
node
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   300
   (bytestring) The node of the file revision whose data is represented.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   301
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   302
deltabasenode
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   303
   (bytestring) Node of the file revision the following delta is against.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   304
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   305
   Only present if the ``revision`` field is requested and delta data
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   306
   follows this map.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   307
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   308
fieldsfollowing
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   309
   (array of 2-array) Denotes extra bytestring fields that following this map.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   310
   See the documentation for ``changesetdata`` for semantics.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   311
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   312
   The following named fields may be present:
39655
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   313
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   314
   ``delta``
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   315
      The delta data to use to construct the fulltext revision.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   316
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   317
      Only present if the ``revision`` field is requested and a delta is
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   318
      being emitted. The ``deltabasenode`` top-level key will also be
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   319
      present if this field is being emitted.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   320
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   321
   ``revision``
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   322
      The fulltext revision data for this manifest. Only present if the
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   323
      ``revision`` field is requested and a fulltext revision is being emitted.
39655
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   324
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   325
parents
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   326
   (array of bytestring) The nodes of the parents of this file revision.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   327
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   328
   Only present if the ``parents`` field is requested.
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   329
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   330
When ``revision`` data is requested, the server chooses to emit either fulltext
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   331
revision data or a delta. What the server decides can be inferred by looking
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   332
for the presence of the ``delta`` or ``revision`` keys in the
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   333
``fieldsfollowing`` array.
39655
0e03e6a44dee wireprotov2: define and implement "filedata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39653
diff changeset
   334
37485
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   335
heads
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   336
-----
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   337
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   338
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
   339
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   340
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
   341
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   342
publiconly (optional)
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   343
   (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
   344
   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
   345
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   346
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
   347
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
   348
changesets satisfied the request.
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   349
0b7475ea38cf wireproto: port heads command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37393
diff changeset
   350
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
   351
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   352
known
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   353
-----
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   354
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   355
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
   356
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   357
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
   358
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   359
nodes
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   360
   (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
   361
   query.
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   362
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   363
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
   364
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
   365
6847542bb8d7 wireproto: port keep command to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37485
diff changeset
   366
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
   367
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   368
listkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   369
--------
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   370
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   371
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
   372
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   373
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
   374
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   375
namespace
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   376
   (bytestring) Pushkey namespace to query.
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   377
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   378
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
   379
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37486
diff changeset
   380
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
   381
37538
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   382
lookup
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   383
------
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   384
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   385
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
   386
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   387
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
   388
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
   389
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   390
The command receives the following arguments:
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   391
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   392
key
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   393
   (bytestring) Value to try to resolve.
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   394
89fed81bbb6c wireproto: port lookup to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37537
diff changeset
   395
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
   396
39653
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   397
manifestdata
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   398
------------
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   399
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   400
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: 39650
diff changeset
   401
a revision).
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   402
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   403
The command accepts the following arguments:
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   404
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   405
fields
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   406
   (set of bytestring) Which data associated with manifests to fetch.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   407
   The following values are recognized:
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   408
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   409
   parents
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   410
      Parent nodes for the manifest.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   411
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   412
   revision
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   413
      The raw revision data for the manifest.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   414
39657
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   415
haveparents
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   416
   (bool) Whether the client has the parent revisions of all requested
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   417
   nodes. If set, the server may emit revision data as deltas against
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   418
   any parent revision. If not set, the server MUST only emit deltas for
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   419
   revisions previously emitted by this command.
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   420
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   421
   False is assumed in the absence of any value.
aa7e312375cf wireprotov2: let clients drive delta behavior
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39655
diff changeset
   422
39653
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   423
nodes
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   424
   (array of bytestring) Manifest nodes whose data to retrieve.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   425
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   426
tree
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   427
   (bytestring) Path to manifest to retrieve. The empty bytestring represents
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   428
   the root manifest. All other values represent directories/trees within
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   429
   the repository.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   430
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   431
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: 39650
diff changeset
   432
revisions or ranges)
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   433
TODO consider recursive expansion of manifests (with path filtering for
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   434
narrow use cases)
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   435
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   436
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: 39650
diff changeset
   437
follows. It has the following bytestring keys:
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   438
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   439
totalitems
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   440
   (unsigned integer) Total number of manifest revisions whose data is
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   441
   being returned.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   442
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   443
Following the map header is a series of 0 or more CBOR values. If values
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   444
are present, the first value will always be a map describing a single manifest
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   445
revision.
39653
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   446
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   447
If the ``fieldsfollowing`` key is present, the map will immediately be followed
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   448
by N CBOR bytestring values, where N is the number of elements in
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   449
``fieldsfollowing``. Each bytestring value corresponds to a field denoted
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   450
by ``fieldsfollowing``.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   451
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   452
Following the optional bytestring field values is the next revision descriptor
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   453
map, or end of stream.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   454
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   455
Each revision descriptor map has the following bytestring keys:
39653
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   456
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   457
node
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   458
   (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: 39650
diff changeset
   459
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   460
deltabasenode
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   461
   (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: 39650
diff changeset
   462
   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: 39650
diff changeset
   463
   a delta is being emitted.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   464
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   465
fieldsfollowing
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   466
   (array of 2-array) Denotes extra bytestring fields that following this map.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   467
   See the documentation for ``changesetdata`` for semantics.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   468
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   469
   The following named fields may be present:
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   470
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   471
   ``delta``
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   472
      The delta data to use to construct the fulltext revision.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   473
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   474
      Only present if the ``revision`` field is requested and a delta is
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   475
      being emitted. The ``deltabasenode`` top-level key will also be
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   476
      present if this field is being emitted.
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   477
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   478
   ``revision``
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   479
      The fulltext revision data for this manifest. Only present if the
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   480
      ``revision`` field is requested and a fulltext revision is being emitted.
39653
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   481
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   482
parents
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   483
   (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: 39650
diff changeset
   484
   Only present if the ``parents`` field is requested.
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   485
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   486
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: 39650
diff changeset
   487
revision data or a delta. What the server decides can be inferred by looking
39819
d059cb669632 wireprotov2: allow multiple fields to follow revision maps
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39818
diff changeset
   488
for the presence of ``delta`` or ``revision`` in the ``fieldsfollowing`` array.
39653
c7a7c7e844e5 wireprotov2: define and implement "manifestdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39650
diff changeset
   489
37537
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   490
pushkey
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   491
-------
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   492
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   493
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
   494
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   495
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
   496
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   497
namespace
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   498
   (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
   499
key
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   500
   (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
   501
old
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   502
   (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
   503
new
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   504
   (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
   505
be5d4749edc0 wireproto: port pushkey command to wire protocol version 2
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37535
diff changeset
   506
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
   507
TODO better define response type and meaning.