author | Yuya Nishihara <yuya@tcha.org> |
Sat, 19 Dec 2020 12:01:58 +0900 | |
changeset 46176 | 300f6e23882a |
parent 43676 | 2e017696181f |
permissions | -rw-r--r-- |
36481
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 |
Bundle2 refers to a data format that is used for both on-disk storage |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 |
and over-the-wire transfer of repository data and state. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 |
The data format allows the capture of multiple components of |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 |
repository data. Contrast with the initial bundle format, which |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 |
only captured *changegroup* data (and couldn't store bookmarks, |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 |
phases, etc). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 |
Bundle2 is used for: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
10 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 |
* Transferring data from a repository (e.g. as part of an ``hg clone`` |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 |
or ``hg pull`` operation). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 |
* Transferring data to a repository (e.g. as part of an ``hg push`` |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
14 |
operation). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
15 |
* Storing data on disk (e.g. the result of an ``hg bundle`` |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 |
operation). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 |
* Transferring the results of a repository operation (e.g. the |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
18 |
reply to an ``hg push`` operation). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
19 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
20 |
At its highest level, a bundle2 payload is a stream that begins |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
21 |
with some metadata and consists of a series of *parts*, with each |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 |
part describing repository data or state or the result of an |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 |
operation. New bundle2 parts are introduced over time when there is |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
24 |
a need to capture a new form of data. A *capabilities* mechanism |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
25 |
exists to allow peers to understand which bundle2 parts the other |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
26 |
understands. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
27 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
28 |
Stream Format |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
29 |
============= |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
30 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
31 |
A bundle2 payload consists of a magic string (``HG20``) followed by |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
32 |
stream level parameters, followed by any number of payload *parts*. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
33 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
34 |
It may help to think of the stream level parameters as *headers* and the |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
35 |
payload parts as the *body*. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
36 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
37 |
Stream Level Parameters |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
38 |
----------------------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
39 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
40 |
Following the magic string is data that defines parameters applicable to the |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
41 |
entire payload. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
42 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
43 |
Stream level parameters begin with a 32-bit unsigned big-endian integer. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
44 |
The value of this integer defines the number of bytes of stream level |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
45 |
parameters that follow. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
46 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
47 |
The *N* bytes of raw data contains a space separated list of parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
48 |
Each parameter consists of a required name and an optional value. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
49 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
50 |
Parameters have the form ``<name>`` or ``<name>=<value>``. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
51 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
52 |
Both the parameter name and value are URL quoted. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
53 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
54 |
Names MUST start with a letter. If the first letter is lower case, the |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
55 |
parameter is advisory and can safely be ignored. If the first letter |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
56 |
is upper case, the parameter is mandatory and the handler MUST stop if |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
57 |
it is unable to process it. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
58 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
59 |
Stream level parameters apply to the entire bundle2 payload. Lower-level |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
60 |
options should go into a bundle2 part instead. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
61 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
62 |
The following stream level parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
63 |
|
37805
8c8b6d13949a
internals: correct capitalization of 'compression' stream level parameter
Kim Alvefur <zash@zash.se>
parents:
36481
diff
changeset
|
64 |
Compression |
36481
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
65 |
Compression format of payload data. ``GZ`` denotes zlib. ``BZ`` |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
66 |
denotes bzip2. ``ZS`` denotes zstandard. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
67 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
68 |
When defined, all bytes after the stream level parameters are |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
69 |
compressed using the compression format defined by this parameter. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
70 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
71 |
If this parameter isn't present, data is raw/uncompressed. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
72 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
73 |
This parameter MUST be mandatory because attempting to consume |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
74 |
streams without knowing how to decode the underlying bytes will |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
75 |
result in errors. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
76 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
77 |
Payload Part |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
78 |
------------ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
79 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
80 |
Following the stream level parameters are 0 or more payload parts. Each |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
81 |
payload part consists of a header and a body. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
82 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
83 |
The payload part header consists of a 32-bit unsigned big-endian integer |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
84 |
defining the number of bytes in the header that follow. The special |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
85 |
value ``0`` indicates the end of the bundle2 stream. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
86 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
87 |
The binary format of the part header is as follows: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
88 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
89 |
* 8-bit unsigned size of the part name |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
90 |
* N-bytes alphanumeric part name |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
91 |
* 32-bit unsigned big-endian part ID |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
92 |
* N bytes part parameter data |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
93 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
94 |
The *part name* identifies the type of the part. A part name with an |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
95 |
UPPERCASE letter is mandatory. Otherwise, the part is advisory. A |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
96 |
consumer should abort if it encounters a mandatory part it doesn't know |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
97 |
how to process. See the sections below for each defined part type. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
98 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
99 |
The *part ID* is a unique identifier within the bundle used to refer to a |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
100 |
specific part. It should be unique within the bundle2 payload. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
101 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
102 |
Part parameter data consists of: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
103 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
104 |
* 1 byte number of mandatory parameters |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
105 |
* 1 byte number of advisory parameters |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
106 |
* 2 * N bytes of sizes of parameter key and values |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
107 |
* N * M blobs of values for parameter key and values |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
108 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
109 |
Following the 2 bytes of mandatory and advisory parameter counts are |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
110 |
2-tuples of bytes of the sizes of each parameter. e.g. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
111 |
(<key size>, <value size>). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
112 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
113 |
Following that are the raw values, without padding. Mandatory parameters |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
114 |
come first, followed by advisory parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
115 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
116 |
Each parameter's key MUST be unique within the part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
117 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
118 |
Following the part parameter data is the part payload. The part payload |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
119 |
consists of a series of framed chunks. The frame header is a 32-bit |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
120 |
big-endian integer defining the size of the chunk. The N bytes of raw |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
121 |
payload data follows. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
122 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
123 |
The part payload consists of 0 or more chunks. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
124 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
125 |
A chunk with size ``0`` denotes the end of the part payload. Therefore, |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
126 |
there will always be at least 1 32-bit integer following the payload |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
127 |
part header. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
128 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
129 |
A chunk size of ``-1`` is used to signal an *interrupt*. If such a chunk |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
130 |
size is seen, the stream processor should process the next bytes as a new |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
131 |
payload part. After this payload part, processing of the original, |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
132 |
interrupted part should resume. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
133 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
134 |
Capabilities |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
135 |
============ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
136 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
137 |
Bundle2 is a dynamic format that can evolve over time. For example, |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
138 |
when a new repository data concept is invented, a new bundle2 part |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
139 |
is typically invented to hold that data. In addition, parts performing |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
140 |
similar functionality may come into existence if there is a better |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
141 |
mechanism for performing certain functionality. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
142 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
143 |
Because the bundle2 format evolves over time, peers need to understand |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
144 |
what bundle2 features the other can understand. The *capabilities* |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
145 |
mechanism is how those features are expressed. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
146 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
147 |
Bundle2 capabilities are logically expressed as a dictionary of |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
148 |
string key-value pairs where the keys are strings and the values |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
149 |
are lists of strings. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
150 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
151 |
Capabilities are encoded for exchange between peers. The encoded |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
152 |
capabilities blob consists of a newline (``\n``) delimited list of |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
153 |
entries. Each entry has the form ``<key>`` or ``<key>=<value>``, |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
154 |
depending if the capability has a value. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
155 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
156 |
The capability name is URL quoted (``%XX`` encoding of URL unsafe |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
157 |
characters). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
158 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
159 |
The value, if present, is formed by URL quoting each value in |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
160 |
the capability list and concatenating the result with a comma (``,``). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
161 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
162 |
For example, the capabilities ``novaluekey`` and ``listvaluekey`` |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
163 |
with values ``value 1`` and ``value 2``. This would be encoded as: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
164 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
165 |
listvaluekey=value%201,value%202\nnovaluekey |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
166 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
167 |
The sections below detail the defined bundle2 capabilities. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
168 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
169 |
HG20 |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
170 |
---- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
171 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
172 |
Denotes that the peer supports the bundle2 data format. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
173 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
174 |
bookmarks |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
175 |
--------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
176 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
177 |
Denotes that the peer supports the ``bookmarks`` part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
178 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
179 |
Peers should not issue mandatory ``bookmarks`` parts unless this |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
180 |
capability is present. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
181 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
182 |
changegroup |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
183 |
----------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
184 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
185 |
Denotes which versions of the *changegroup* format the peer can |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
186 |
receive. Values include ``01``, ``02``, and ``03``. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
187 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
188 |
The peer should not generate changegroup data for a version not |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
189 |
specified by this capability. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
190 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
191 |
checkheads |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
192 |
---------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
193 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
194 |
Denotes which forms of heads checking the peer supports. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
195 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
196 |
If ``related`` is in the value, then the peer supports the ``check:heads`` |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
197 |
part and the peer is capable of detecting race conditions when applying |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
198 |
changelog data. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
199 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
200 |
digests |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
201 |
------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
202 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
203 |
Denotes which hashing formats the peer supports. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
204 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
205 |
Values are names of hashing function. Values include ``md5``, ``sha1``, |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
206 |
and ``sha512``. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
207 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
208 |
error |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
209 |
----- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
210 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
211 |
Denotes which ``error:`` parts the peer supports. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
212 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
213 |
Value is a list of strings of ``error:`` part names. Valid values |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
214 |
include ``abort``, ``unsupportecontent``, ``pushraced``, and ``pushkey``. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
215 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
216 |
Peers should not issue an ``error:`` part unless the type of that |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
217 |
part is listed as supported by this capability. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
218 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
219 |
listkeys |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
220 |
-------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
221 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
222 |
Denotes that the peer supports the ``listkeys`` part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
223 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
224 |
hgtagsfnodes |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
225 |
------------ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
226 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
227 |
Denotes that the peer supports the ``hgtagsfnodes`` part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
228 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
229 |
obsmarkers |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
230 |
---------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
231 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
232 |
Denotes that the peer supports the ``obsmarker`` part and which versions |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
233 |
of the obsolescence data format it can receive. Values are strings like |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
234 |
``V<N>``. e.g. ``V1``. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
235 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
236 |
phases |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
237 |
------ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
238 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
239 |
Denotes that the peer supports the ``phases`` part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
240 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
241 |
pushback |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
242 |
-------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
243 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
244 |
Denotes that the peer supports sending/receiving bundle2 data in response |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
245 |
to a bundle2 request. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
246 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
247 |
This capability is typically used by servers that employ server-side |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
248 |
rewriting of pushed repository data. For example, a server may wish to |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
249 |
automatically rebase pushed changesets. When this capability is present, |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
250 |
the server can send a bundle2 response containing the rewritten changeset |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
251 |
data and the client will apply it. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
252 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
253 |
pushkey |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
254 |
------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
255 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
256 |
Denotes that the peer supports the ``puskey`` part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
257 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
258 |
remote-changegroup |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
259 |
------------------ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
260 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
261 |
Denotes that the peer supports the ``remote-changegroup`` part and |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
262 |
which protocols it can use to fetch remote changegroup data. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
263 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
264 |
Values are protocol names. e.g. ``http`` and ``https``. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
265 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
266 |
stream |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
267 |
------ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
268 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
269 |
Denotes that the peer supports ``stream*`` parts in order to support |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
270 |
*stream clone*. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
271 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
272 |
Values are which ``stream*`` parts the peer supports. ``v2`` denotes |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
273 |
support for the ``stream2`` part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
274 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
275 |
Bundle2 Part Types |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
276 |
================== |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
277 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
278 |
The sections below detail the various bundle2 part types. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
279 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
280 |
bookmarks |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
281 |
--------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
282 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
283 |
The ``bookmarks`` part holds bookmarks information. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
284 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
285 |
This part has no parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
286 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
287 |
The payload consists of entries defining bookmarks. Each entry consists of: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
288 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
289 |
* 20 bytes binary changeset node. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
290 |
* 2 bytes big endian short defining bookmark name length. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
291 |
* N bytes defining bookmark name. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
292 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
293 |
Receivers typically update bookmarks to match the state specified in |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
294 |
this part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
295 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
296 |
changegroup |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
297 |
----------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
298 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
299 |
The ``changegroup`` part contains *changegroup* data (changelog, manifestlog, |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
300 |
and filelog revision data). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
301 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
302 |
The following part parameters are defined for this part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
303 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
304 |
version |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
305 |
Changegroup version string. e.g. ``01``, ``02``, and ``03``. This parameter |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
306 |
determines how to interpret the changegroup data within the part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
307 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
308 |
nbchanges |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
309 |
The number of changesets in this changegroup. This parameter can be used |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
310 |
to aid in the display of progress bars, etc during part application. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
311 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
312 |
treemanifest |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
313 |
Whether the changegroup contains tree manifests. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
314 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
315 |
targetphase |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
316 |
The target phase of changesets in this part. Value is an integer of |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
317 |
the target phase. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
318 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
319 |
The payload of this part is raw changegroup data. See |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
320 |
:hg:`help internals.changegroups` for the format of changegroup data. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
321 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
322 |
check:bookmarks |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
323 |
--------------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
324 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
325 |
The ``check:bookmarks`` part is inserted into a bundle as a means for the |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
326 |
receiver to validate that the sender's known state of bookmarks matches |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
327 |
the receiver's. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
328 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
329 |
This part has no parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
330 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
331 |
The payload is a binary stream of bookmark data. Each entry in the stream |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
332 |
consists of: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
333 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
334 |
* 20 bytes binary node that bookmark is associated with |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
335 |
* 2 bytes unsigned short defining length of bookmark name |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
336 |
* N bytes containing the bookmark name |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
337 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
338 |
If all bits in the node value are ``1``, then this signifies a missing |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
339 |
bookmark. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
340 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
341 |
When the receiver encounters this part, for each bookmark in the part |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
342 |
payload, it should validate that the current bookmark state matches |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
343 |
the specified state. If it doesn't, then the receiver should take |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
344 |
appropriate action. (In the case of pushes, this mismatch signifies |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
345 |
a race condition and the receiver should consider rejecting the push.) |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
346 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
347 |
check:heads |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
348 |
----------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
349 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
350 |
The ``check:heads`` part is a means to validate that the sender's state |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
351 |
of DAG heads matches the receiver's. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
352 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
353 |
This part has no parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
354 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
355 |
The body of this part is an array of 20 byte binary nodes representing |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
356 |
changeset heads. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
357 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
358 |
Receivers should compare the set of heads defined in this part to the |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
359 |
current set of repo heads and take action if there is a mismatch in that |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
360 |
set. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
361 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
362 |
Note that this part applies to *all* heads in the repo. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
363 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
364 |
check:phases |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
365 |
------------ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
366 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
367 |
The ``check:phases`` part validates that the sender's state of phase |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
368 |
boundaries matches the receiver's. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
369 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
370 |
This part has no parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
371 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
372 |
The payload consists of an array of 24 byte entries. Each entry is |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
373 |
a big endian 32-bit integer defining the phase integer and 20 byte |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
374 |
binary node value. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
375 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
376 |
For each changeset defined in this part, the receiver should validate |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
377 |
that its current phase matches the phase defined in this part. The |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
378 |
receiver should take appropriate action if a mismatch occurs. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
379 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
380 |
check:updated-heads |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
381 |
------------------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
382 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
383 |
The ``check:updated-heads`` part validates that the sender's state of |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
384 |
DAG heads updated by this bundle matches the receiver's. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
385 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
386 |
This type is nearly identical to ``check:heads`` except the heads |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
387 |
in the payload are only a subset of heads in the repository. The |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
388 |
receiver should validate that all nodes specified by the sender are |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
389 |
branch heads and take appropriate action if not. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
390 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
391 |
error:abort |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
392 |
----------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
393 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
394 |
The ``error:abort`` part conveys a fatal error. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
395 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
396 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
397 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
398 |
message |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
399 |
The string content of the error message. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
400 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
401 |
hint |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
402 |
Supplemental string giving a hint on how to fix the problem. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
403 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
404 |
error:pushkey |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
405 |
------------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
406 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
407 |
The ``error:pushkey`` part conveys an error in the *pushkey* protocol. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
408 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
409 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
410 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
411 |
namespace |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
412 |
The pushkey domain that exhibited the error. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
413 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
414 |
key |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
415 |
The key whose update failed. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
416 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
417 |
new |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
418 |
The value we tried to set the key to. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
419 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
420 |
old |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
421 |
The old value of the key (as supplied by the client). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
422 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
423 |
ret |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
424 |
The integer result code for the pushkey request. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
425 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
426 |
in-reply-to |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
427 |
Part ID that triggered this error. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
428 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
429 |
This part is generated if there was an error applying *pushkey* data. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
430 |
Pushkey data includes bookmarks, phases, and obsolescence markers. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
431 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
432 |
error:pushraced |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
433 |
--------------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
434 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
435 |
The ``error:pushraced`` part conveys that an error occurred and |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
436 |
the likely cause is losing a race with another pusher. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
437 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
438 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
439 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
440 |
message |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
441 |
String error message. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
442 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
443 |
This part is typically emitted when a receiver examining ``check:*`` |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
444 |
parts encountered inconsistency between incoming state and local state. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
445 |
The likely cause of that inconsistency is another repository change |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
446 |
operation (often another client performing an ``hg push``). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
447 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
448 |
error:unsupportedcontent |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
449 |
------------------------ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
450 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
451 |
The ``error:unsupportedcontent`` part conveys that a bundle2 receiver |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
452 |
encountered a part or content it was not able to handle. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
453 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
454 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
455 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
456 |
parttype |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
457 |
The name of the part that triggered this error. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
458 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
459 |
params |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
460 |
``\0`` delimited list of parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
461 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
462 |
hgtagsfnodes |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
463 |
------------ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
464 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
465 |
The ``hgtagsfnodes`` type defines file nodes for the ``.hgtags`` file |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
466 |
for various changesets. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
467 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
468 |
This part has no parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
469 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
470 |
The payload is an array of pairs of 20 byte binary nodes. The first node |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
471 |
is a changeset node. The second node is the ``.hgtags`` file node. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
472 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
473 |
Resolving tags requires resolving the ``.hgtags`` file node for changesets. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
474 |
On large repositories, this can be expensive. Repositories cache the |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
475 |
mapping of changeset to ``.hgtags`` file node on disk as a performance |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
476 |
optimization. This part allows that cached data to be transferred alongside |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
477 |
changeset data. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
478 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
479 |
Receivers should update their ``.hgtags`` cache file node mappings with |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
480 |
the incoming data. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
481 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
482 |
listkeys |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
483 |
-------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
484 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
485 |
The ``listkeys`` part holds content for a *pushkey* namespace. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
486 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
487 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
488 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
489 |
namespace |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
490 |
The pushkey domain this data belongs to. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
491 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
492 |
The part payload contains a newline (``\n``) delimited list of |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
493 |
tab (``\t``) delimited key-value pairs defining entries in this pushkey |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
494 |
namespace. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
495 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
496 |
obsmarkers |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
497 |
---------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
498 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
499 |
The ``obsmarkers`` part defines obsolescence markers. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
500 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
501 |
This part has no parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
502 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
503 |
The payload consists of obsolescence markers using the on-disk markers |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
504 |
format. The first byte defines the version format. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
505 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
506 |
The receiver should apply the obsolescence markers defined in this |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
507 |
part. A ``reply:obsmarkers`` part should be sent to the sender, if possible. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
508 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
509 |
output |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
510 |
------ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
511 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
512 |
The ``output`` part is used to display output on the receiver. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
513 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
514 |
This part has no parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
515 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
516 |
The payload consists of raw data to be printed on the receiver. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
517 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
518 |
phase-heads |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
519 |
----------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
520 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
521 |
The ``phase-heads`` part defines phase boundaries. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
522 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
523 |
This part has no parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
524 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
525 |
The payload consists of an array of 24 byte entries. Each entry is |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
526 |
a big endian 32-bit integer defining the phase integer and 20 byte |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
527 |
binary node value. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
528 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
529 |
pushkey |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
530 |
------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
531 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
532 |
The ``pushkey`` part communicates an intent to perform a ``pushkey`` |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
533 |
request. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
534 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
535 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
536 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
537 |
namespace |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
538 |
The pushkey domain to operate on. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
539 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
540 |
key |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
541 |
The key within the pushkey namespace that is being changed. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
542 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
543 |
old |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
544 |
The old value for the key being changed. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
545 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
546 |
new |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
547 |
The new value for the key being changed. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
548 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
549 |
This part has no payload. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
550 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
551 |
The receiver should perform a pushkey operation as described by this |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
552 |
part's parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
553 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
554 |
If the pushey operation fails, a ``reply:pushkey`` part should be sent |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
555 |
back to the sender, if possible. The ``in-reply-to`` part parameter |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
556 |
should reference the source part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
557 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
558 |
pushvars |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
559 |
-------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
560 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
561 |
The ``pushvars`` part defines environment variables that should be |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
562 |
set when processing this bundle2 payload. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
563 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
564 |
The part's advisory parameters define environment variables. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
565 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
566 |
There is no part payload. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
567 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
568 |
When received, part parameters are prefixed with ``USERVAR_`` and the |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
569 |
resulting variables are defined in the hooks context for the current |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
570 |
bundle2 application. This part provides a mechanism for senders to |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
571 |
inject extra state into the hook execution environment on the receiver. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
572 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
573 |
remote-changegroup |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
574 |
------------------ |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
575 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
576 |
The ``remote-changegroup`` part defines an external location of a bundle |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
577 |
to apply. This part can be used by servers to serve pre-generated bundles |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
578 |
hosted at arbitrary URLs. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
579 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
580 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
581 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
582 |
url |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
583 |
The URL of the remote bundle. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
584 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
585 |
size |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
586 |
The size in bytes of the remote bundle. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
587 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
588 |
digests |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
589 |
A space separated list of the digest types provided in additional |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
590 |
part parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
591 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
592 |
digest:<type> |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
593 |
The hexadecimal representation of the digest (hash) of the remote bundle. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
594 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
595 |
There is no payload for this part type. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
596 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
597 |
When encountered, clients should attempt to fetch the URL being advertised |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
598 |
and read and apply it as a bundle. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
599 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
600 |
The ``size`` and ``digest:<type>`` parameters should be used to validate |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
601 |
that the downloaded bundle matches what was advertised. If a mismatch occurs, |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
602 |
the client should abort. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
603 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
604 |
reply:changegroup |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
605 |
----------------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
606 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
607 |
The ``reply:changegroup`` part conveys the results of application of a |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
608 |
``changegroup`` part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
609 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
610 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
611 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
612 |
return |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
613 |
Integer return code from changegroup application. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
614 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
615 |
in-reply-to |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
616 |
Part ID of part this reply is in response to. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
617 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
618 |
reply:obsmarkers |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
619 |
---------------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
620 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
621 |
The ``reply:obsmarkers`` part conveys the results of applying an |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
622 |
``obsmarkers`` part. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
623 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
624 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
625 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
626 |
new |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
627 |
The integer number of new markers that were applied. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
628 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
629 |
in-reply-to |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
630 |
The part ID that this part is in reply to. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
631 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
632 |
reply:pushkey |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
633 |
------------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
634 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
635 |
The ``reply:pushkey`` part conveys the result of a *pushkey* operation. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
636 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
637 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
638 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
639 |
return |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
640 |
Integer result code from pushkey operation. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
641 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
642 |
in-reply-to |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
643 |
Part ID that triggered this pushkey operation. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
644 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
645 |
This part has no payload. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
646 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
647 |
replycaps |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
648 |
--------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
649 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
650 |
The ``replycaps`` part notifies the receiver that a reply bundle should |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
651 |
be created. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
652 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
653 |
This part has no parameters. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
654 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
655 |
The payload consists of a bundle2 capabilities blob. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
656 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
657 |
stream2 |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
658 |
------- |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
659 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
660 |
The ``stream2`` part contains *streaming clone* version 2 data. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
661 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
662 |
The following part parameters are defined: |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
663 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
664 |
requirements |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
665 |
URL quoted repository requirements string. Requirements are delimited by a |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
666 |
command (``,``). |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
667 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
668 |
filecount |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
669 |
The total number of files being transferred in the payload. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
670 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
671 |
bytecount |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
672 |
The total size of file content being transferred in the payload. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
673 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
674 |
The payload consists of raw stream clone version 2 data. |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
675 |
|
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
676 |
The ``filecount`` and ``bytecount`` parameters can be used for progress and |
1fa35ca345a5
internals: document bundle2 format
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
677 |
reporting purposes. The values may not be exact. |