comparison tests/test-help.t @ 40047:8e398628a3f2

repository: define and use revision flag constants Revlogs have a per-revision 2 byte field holding integer flags that define how revision data should be interpreted. For historical reasons, these integer values are sent verbatim on the wire protocol as part of changegroup data. From a semantic standpoint, the flags that go out over the wire are different from the flags stored internally by revlogs. Failure to establish this semantic distinction creates unwanted strong coupling between revlog's internals and the wire protocol. This commit establishes new constants on the repository module that define the revision flags used by the wire protocol (and by some internal storage APIs, sadly). The changegroups internals documentation has been updated to document them explicitly. Various references throughout the repo now use the repository constants instead of the revlog constants. This is done to make it clear that we're operating on generic revision data and this isn't tied to revlogs. Differential Revision: https://phab.mercurial-scm.org/D4860
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 03 Oct 2018 12:57:01 -0700
parents cd5f2e615262
children 6e7789064c21
comparison
equal deleted inserted replaced
40046:50700a025953 40047:8e398628a3f2
1036 the changelog data, root/flat manifest data, treemanifest data, and 1036 the changelog data, root/flat manifest data, treemanifest data, and
1037 filelogs. 1037 filelogs.
1038 1038
1039 There are 3 versions of changegroups: "1", "2", and "3". From a high- 1039 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1040 level, versions "1" and "2" are almost exactly the same, with the only 1040 level, versions "1" and "2" are almost exactly the same, with the only
1041 difference being an additional item in the *delta header*. Version "3" 1041 difference being an additional item in the *delta header*. Version "3"
1042 adds support for revlog flags in the *delta header* and optionally 1042 adds support for storage flags in the *delta header* and optionally
1043 exchanging treemanifests (enabled by setting an option on the 1043 exchanging treemanifests (enabled by setting an option on the
1044 "changegroup" part in the bundle2). 1044 "changegroup" part in the bundle2).
1045 1045
1046 Changegroups when not exchanging treemanifests consist of 3 logical 1046 Changegroups when not exchanging treemanifests consist of 3 logical
1047 segments: 1047 segments:
1159 changegroup. 1159 changegroup.
1160 1160
1161 In version 2 and up, the delta base node is encoded in the entry in the 1161 In version 2 and up, the delta base node is encoded in the entry in the
1162 changegroup. This allows the delta to be expressed against any parent, 1162 changegroup. This allows the delta to be expressed against any parent,
1163 which can result in smaller deltas and more efficient encoding of data. 1163 which can result in smaller deltas and more efficient encoding of data.
1164
1165 The *flags* field holds bitwise flags affecting the processing of revision
1166 data. The following flags are defined:
1167
1168 32768
1169 Censored revision. The revision's fulltext has been replaced by censor
1170 metadata. May only occur on file revisions.
1171
1172 16384
1173 Ellipsis revision. Revision hash does not match data (likely due to
1174 rewritten parents).
1175
1176 8192
1177 Externally stored. The revision fulltext contains "key:value" "\n"
1178 delimited metadata defining an object stored elsewhere. Used by the LFS
1179 extension.
1180
1181 For historical reasons, the integer values are identical to revlog version
1182 1 per-revision storage flags and correspond to bits being set in this
1183 2-byte field. Bits were allocated starting from the most-significant bit,
1184 hence the reverse ordering and allocation of these flags.
1164 1185
1165 Changeset Segment 1186 Changeset Segment
1166 ================= 1187 =================
1167 1188
1168 The *changeset segment* consists of a single *delta group* holding 1189 The *changeset segment* consists of a single *delta group* holding
3433 filelogs. 3454 filelogs.
3434 </p> 3455 </p>
3435 <p> 3456 <p>
3436 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a 3457 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3437 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the 3458 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3438 only difference being an additional item in the *delta header*. Version 3459 only difference being an additional item in the *delta header*. Version
3439 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally 3460 &quot;3&quot; adds support for storage flags in the *delta header* and optionally
3440 exchanging treemanifests (enabled by setting an option on the 3461 exchanging treemanifests (enabled by setting an option on the
3441 &quot;changegroup&quot; part in the bundle2). 3462 &quot;changegroup&quot; part in the bundle2).
3442 </p> 3463 </p>
3443 <p> 3464 <p>
3444 Changegroups when not exchanging treemanifests consist of 3 logical 3465 Changegroups when not exchanging treemanifests consist of 3 logical
3579 </p> 3600 </p>
3580 <p> 3601 <p>
3581 In version 2 and up, the delta base node is encoded in the entry in the 3602 In version 2 and up, the delta base node is encoded in the entry in the
3582 changegroup. This allows the delta to be expressed against any parent, 3603 changegroup. This allows the delta to be expressed against any parent,
3583 which can result in smaller deltas and more efficient encoding of data. 3604 which can result in smaller deltas and more efficient encoding of data.
3605 </p>
3606 <p>
3607 The *flags* field holds bitwise flags affecting the processing of revision
3608 data. The following flags are defined:
3609 </p>
3610 <dl>
3611 <dt>32768
3612 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions.
3613 <dt>16384
3614 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents).
3615 <dt>8192
3616 <dd>Externally stored. The revision fulltext contains &quot;key:value&quot; &quot;\n&quot; delimited metadata defining an object stored elsewhere. Used by the LFS extension.
3617 </dl>
3618 <p>
3619 For historical reasons, the integer values are identical to revlog version 1
3620 per-revision storage flags and correspond to bits being set in this 2-byte
3621 field. Bits were allocated starting from the most-significant bit, hence the
3622 reverse ordering and allocation of these flags.
3584 </p> 3623 </p>
3585 <h2>Changeset Segment</h2> 3624 <h2>Changeset Segment</h2>
3586 <p> 3625 <p>
3587 The *changeset segment* consists of a single *delta group* holding 3626 The *changeset segment* consists of a single *delta group* holding
3588 changelog data. The *empty chunk* at the end of the *delta group* denotes 3627 changelog data. The *empty chunk* at the end of the *delta group* denotes