mercurial/helptext/internals/changegroups.txt
author Joerg Sonnenberger <joerg@bec.de>
Mon, 29 Mar 2021 01:35:54 +0200
changeset 46841 e7b4607d52e3
parent 43632 2e017696181f
child 47077 119790e1c67c
permissions -rw-r--r--
setdiscovery: simplify by using tiprev directly tip() uses tiprev() and reads the node from it, so drop a layer of indirection. Differential Revision: https://phab.mercurial-scm.org/D10289
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
Changegroups are representations of repository revlog data, specifically
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
     2
the changelog data, root/flat manifest data, treemanifest data, and
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
     3
filelogs.
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
27434
11150176a000 changegroups: add documentation for cg3
Augie Fackler <augie@google.com>
parents: 27372
diff changeset
     5
There are 3 versions of changegroups: ``1``, ``2``, and ``3``. From a
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
     6
high-level, versions ``1`` and ``2`` are almost exactly the same, with the
40047
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
     7
only difference being an additional item in the *delta header*. Version
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
     8
``3`` adds support for storage flags in the *delta header* and optionally
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
     9
exchanging treemanifests (enabled by setting an option on the
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    10
``changegroup`` part in the bundle2).
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    12
Changegroups when not exchanging treemanifests consist of 3 logical
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    13
segments::
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
   +---------------------------------+
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
   |           |          |          |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
   | changeset | manifest | filelogs |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
   |           |          |          |
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    19
   |           |          |          |
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
   +---------------------------------+
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    22
When exchanging treemanifests, there are 4 logical segments::
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    23
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    24
   +-------------------------------------------------+
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    25
   |           |          |               |          |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    26
   | changeset |   root   | treemanifests | filelogs |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    27
   |           | manifest |               |          |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    28
   |           |          |               |          |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    29
   +-------------------------------------------------+
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    30
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
The principle building block of each segment is a *chunk*. A *chunk*
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
is a framed piece of data::
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    33
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    34
   +---------------------------------------+
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
   |           |                           |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    36
   |  length   |           data            |
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    37
   | (4 bytes) |   (<length - 4> bytes)    |
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
   |           |                           |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
   +---------------------------------------+
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    40
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    41
All integers are big-endian signed integers. Each chunk starts with a 32-bit
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    42
integer indicating the length of the entire chunk (including the length field
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    43
itself).
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    45
There is a special case chunk that has a value of 0 for the length
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    46
(``0x00000000``). We call this an *empty chunk*.
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    47
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    48
Delta Groups
29747
aba2bb2a6d0f help: don't try to render a section on sub-topics
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27434
diff changeset
    49
============
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
A *delta group* expresses the content of a revlog as a series of deltas,
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
or patches against previous revisions.
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    53
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    54
Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
to signal the end of the delta group::
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    56
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
  +------------------------------------------------------------------------+
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
  |                |             |               |             |           |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    59
  | chunk0 length  | chunk0 data | chunk1 length | chunk1 data |    0x0    |
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    60
  |   (4 bytes)    |  (various)  |   (4 bytes)   |  (various)  | (4 bytes) |
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    61
  |                |             |               |             |           |
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    62
  +------------------------------------------------------------------------+
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    63
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    64
Each *chunk*'s data consists of the following::
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    65
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    66
  +---------------------------------------+
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    67
  |                        |              |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    68
  |     delta header       |  delta data  |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    69
  |  (various by version)  |  (various)   |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    70
  |                        |              |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    71
  +---------------------------------------+
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    72
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    73
The *delta data* is a series of *delta*s that describe a diff from an existing
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    74
entry (either that the recipient already has, or previously specified in the
32139
de86a6872d06 help: spelling fixes
Matt Harbison <matt_harbison@yahoo.com>
parents: 31287
diff changeset
    75
bundle/changegroup).
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    76
27434
11150176a000 changegroups: add documentation for cg3
Augie Fackler <augie@google.com>
parents: 27372
diff changeset
    77
The *delta header* is different between versions ``1``, ``2``, and
11150176a000 changegroups: add documentation for cg3
Augie Fackler <augie@google.com>
parents: 27372
diff changeset
    78
``3`` of the changegroup format.
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    79
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    80
Version 1 (headerlen=80)::
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    81
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    82
   +------------------------------------------------------+
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    83
   |            |             |             |             |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    84
   |    node    |   p1 node   |   p2 node   |  link node  |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    85
   | (20 bytes) |  (20 bytes) |  (20 bytes) |  (20 bytes) |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    86
   |            |             |             |             |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    87
   +------------------------------------------------------+
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    88
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    89
Version 2 (headerlen=100)::
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    90
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    91
   +------------------------------------------------------------------+
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    92
   |            |             |             |            |            |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    93
   |    node    |   p1 node   |   p2 node   | base node  | link node  |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    94
   | (20 bytes) |  (20 bytes) |  (20 bytes) | (20 bytes) | (20 bytes) |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    95
   |            |             |             |            |            |
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    96
   +------------------------------------------------------------------+
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    97
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
    98
Version 3 (headerlen=102)::
27434
11150176a000 changegroups: add documentation for cg3
Augie Fackler <augie@google.com>
parents: 27372
diff changeset
    99
11150176a000 changegroups: add documentation for cg3
Augie Fackler <augie@google.com>
parents: 27372
diff changeset
   100
   +------------------------------------------------------------------------------+
11150176a000 changegroups: add documentation for cg3
Augie Fackler <augie@google.com>
parents: 27372
diff changeset
   101
   |            |             |             |            |            |           |
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   102
   |    node    |   p1 node   |   p2 node   | base node  | link node  |   flags   |
27434
11150176a000 changegroups: add documentation for cg3
Augie Fackler <augie@google.com>
parents: 27372
diff changeset
   103
   | (20 bytes) |  (20 bytes) |  (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
11150176a000 changegroups: add documentation for cg3
Augie Fackler <augie@google.com>
parents: 27372
diff changeset
   104
   |            |             |             |            |            |           |
11150176a000 changegroups: add documentation for cg3
Augie Fackler <augie@google.com>
parents: 27372
diff changeset
   105
   +------------------------------------------------------------------------------+
11150176a000 changegroups: add documentation for cg3
Augie Fackler <augie@google.com>
parents: 27372
diff changeset
   106
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   107
The *delta data* consists of ``chunklen - 4 - headerlen`` bytes, which contain a
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   108
series of *delta*s, densely packed (no separators). These deltas describe a diff
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   109
from an existing entry (either that the recipient already has, or previously
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   110
specified in the bundle/changegroup). The format is described more fully in
31287
16539e32ebe0 help: fix layout of pre-formatted text
Yuya Nishihara <yuya@tcha.org>
parents: 31213
diff changeset
   111
``hg help internals.bdiff``, but briefly::
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   112
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   113
   +---------------------------------------------------------------+
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   114
   |              |            |            |                      |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   115
   | start offset | end offset | new length |        content       |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   116
   |  (4 bytes)   |  (4 bytes) |  (4 bytes) | (<new length> bytes) |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   117
   |              |            |            |                      |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   118
   +---------------------------------------------------------------+
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   119
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   120
Please note that the length field in the delta data does *not* include itself.
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   121
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   122
In version 1, the delta is always applied against the previous node from
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   123
the changegroup or the first parent if this is the first entry in the
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   124
changegroup.
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   125
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   126
In version 2 and up, the delta base node is encoded in the entry in the
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   127
changegroup. This allows the delta to be expressed against any parent,
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   128
which can result in smaller deltas and more efficient encoding of data.
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   129
40047
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   130
The *flags* field holds bitwise flags affecting the processing of revision
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   131
data. The following flags are defined:
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   132
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   133
32768
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   134
   Censored revision. The revision's fulltext has been replaced by censor
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   135
   metadata. May only occur on file revisions.
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   136
16384
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   137
   Ellipsis revision. Revision hash does not match data (likely due to rewritten
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   138
   parents).
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   139
8192
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   140
   Externally stored. The revision fulltext contains ``key:value`` ``\n``
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   141
   delimited metadata defining an object stored elsewhere. Used by the LFS
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   142
   extension.
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   143
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   144
For historical reasons, the integer values are identical to revlog version 1
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   145
per-revision storage flags and correspond to bits being set in this 2-byte
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   146
field. Bits were allocated starting from the most-significant bit, hence the
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   147
reverse ordering and allocation of these flags.
8e398628a3f2 repository: define and use revision flag constants
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32139
diff changeset
   148
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   149
Changeset Segment
29747
aba2bb2a6d0f help: don't try to render a section on sub-topics
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27434
diff changeset
   150
=================
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   151
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   152
The *changeset segment* consists of a single *delta group* holding
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   153
changelog data. The *empty chunk* at the end of the *delta group* denotes
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   154
the boundary to the *manifest segment*.
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   155
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   156
Manifest Segment
29747
aba2bb2a6d0f help: don't try to render a section on sub-topics
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27434
diff changeset
   157
================
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   158
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   159
The *manifest segment* consists of a single *delta group* holding manifest
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   160
data. If treemanifests are in use, it contains only the manifest for the
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   161
root directory of the repository. Otherwise, it contains the entire
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   162
manifest data. The *empty chunk* at the end of the *delta group* denotes
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   163
the boundary to the next segment (either the *treemanifests segment* or the
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   164
*filelogs segment*, depending on version and the request options).
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   165
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   166
Treemanifests Segment
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   167
---------------------
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   168
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   169
The *treemanifests segment* only exists in changegroup version ``3``, and
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   170
only if the 'treemanifest' param is part of the bundle2 changegroup part
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   171
(it is not possible to use changegroup version 3 outside of bundle2).
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   172
Aside from the filenames in the *treemanifests segment* containing a
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   173
trailing ``/`` character, it behaves identically to the *filelogs segment*
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   174
(see below). The final sub-segment is followed by an *empty chunk* (logically,
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   175
a sub-segment with filename size 0). This denotes the boundary to the
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   176
*filelogs segment*.
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   177
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   178
Filelogs Segment
29747
aba2bb2a6d0f help: don't try to render a section on sub-topics
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27434
diff changeset
   179
================
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   180
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   181
The *filelogs segment* consists of multiple sub-segments, each
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   182
corresponding to an individual file whose data is being described::
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   183
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   184
   +--------------------------------------------------+
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   185
   |          |          |          |     |           |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   186
   | filelog0 | filelog1 | filelog2 | ... |    0x0    |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   187
   |          |          |          |     | (4 bytes) |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   188
   |          |          |          |     |           |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   189
   +--------------------------------------------------+
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   190
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   191
The final filelog sub-segment is followed by an *empty chunk* (logically,
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   192
a sub-segment with filename size 0). This denotes the end of the segment
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   193
and of the overall changegroup.
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   194
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   195
Each filelog sub-segment consists of the following::
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   196
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   197
   +------------------------------------------------------+
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   198
   |                 |                      |             |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   199
   | filename length |       filename       | delta group |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   200
   |    (4 bytes)    | (<length - 4> bytes) |  (various)  |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   201
   |                 |                      |             |
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   202
   +------------------------------------------------------+
27372
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   203
a79cba6cb206 help: add documentation for changegroup formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   204
That is, a *chunk* consisting of the filename (not terminated or padded)
31213
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   205
followed by N chunks constituting the *delta group* for this file. The
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   206
*empty chunk* at the end of each *delta group* denotes the boundary to the
9f169b7f53d5 help: fix internals.changegroups
Kyle Lippincott <spectral@google.com>
parents: 29747
diff changeset
   207
next filelog sub-segment.