1134 |
1134 |
1135 Changegroups are representations of repository revlog data, specifically |
1135 Changegroups are representations of repository revlog data, specifically |
1136 the changelog data, root/flat manifest data, treemanifest data, and |
1136 the changelog data, root/flat manifest data, treemanifest data, and |
1137 filelogs. |
1137 filelogs. |
1138 |
1138 |
1139 There are 3 versions of changegroups: "1", "2", and "3". From a high- |
1139 There are 4 versions of changegroups: "1", "2", "3" and "4". From a high- |
1140 level, versions "1" and "2" are almost exactly the same, with the only |
1140 level, versions "1" and "2" are almost exactly the same, with the only |
1141 difference being an additional item in the *delta header*. Version "3" |
1141 difference being an additional item in the *delta header*. Version "3" |
1142 adds support for storage flags in the *delta header* and optionally |
1142 adds support for storage flags in the *delta header* and optionally |
1143 exchanging treemanifests (enabled by setting an option on the |
1143 exchanging treemanifests (enabled by setting an option on the |
1144 "changegroup" part in the bundle2). |
1144 "changegroup" part in the bundle2). Version "4" adds support for |
|
1145 exchanging sidedata (additional revision metadata not part of the digest). |
1145 |
1146 |
1146 Changegroups when not exchanging treemanifests consist of 3 logical |
1147 Changegroups when not exchanging treemanifests consist of 3 logical |
1147 segments: |
1148 segments: |
1148 |
1149 |
1149 +---------------------------------+ |
1150 +---------------------------------+ |
1206 |
1207 |
1207 The *delta data* is a series of *delta*s that describe a diff from an |
1208 The *delta data* is a series of *delta*s that describe a diff from an |
1208 existing entry (either that the recipient already has, or previously |
1209 existing entry (either that the recipient already has, or previously |
1209 specified in the bundle/changegroup). |
1210 specified in the bundle/changegroup). |
1210 |
1211 |
1211 The *delta header* is different between versions "1", "2", and "3" of the |
1212 The *delta header* is different between versions "1", "2", "3" and "4" of |
1212 changegroup format. |
1213 the changegroup format. |
1213 |
1214 |
1214 Version 1 (headerlen=80): |
1215 Version 1 (headerlen=80): |
1215 |
1216 |
1216 +------------------------------------------------------+ |
1217 +------------------------------------------------------+ |
1217 | | | | | |
1218 | | | | | |
1236 | node | p1 node | p2 node | base node | link node | flags | |
1237 | node | p1 node | p2 node | base node | link node | flags | |
1237 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | |
1238 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | |
1238 | | | | | | | |
1239 | | | | | | | |
1239 +------------------------------------------------------------------------------+ |
1240 +------------------------------------------------------------------------------+ |
1240 |
1241 |
|
1242 Version 4 (headerlen=103): |
|
1243 |
|
1244 +------------------------------------------------------------------------------+----------+ |
|
1245 | | | | | | | | |
|
1246 | node | p1 node | p2 node | base node | link node | flags | pflags | |
|
1247 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) | |
|
1248 | | | | | | | | |
|
1249 +------------------------------------------------------------------------------+----------+ |
|
1250 |
1241 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which |
1251 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which |
1242 contain a series of *delta*s, densely packed (no separators). These deltas |
1252 contain a series of *delta*s, densely packed (no separators). These deltas |
1243 describe a diff from an existing entry (either that the recipient already |
1253 describe a diff from an existing entry (either that the recipient already |
1244 has, or previously specified in the bundle/changegroup). The format is |
1254 has, or previously specified in the bundle/changegroup). The format is |
1245 described more fully in "hg help internals.bdiff", but briefly: |
1255 described more fully in "hg help internals.bdiff", but briefly: |
1276 8192 |
1286 8192 |
1277 Externally stored. The revision fulltext contains "key:value" "\n" |
1287 Externally stored. The revision fulltext contains "key:value" "\n" |
1278 delimited metadata defining an object stored elsewhere. Used by the LFS |
1288 delimited metadata defining an object stored elsewhere. Used by the LFS |
1279 extension. |
1289 extension. |
1280 |
1290 |
|
1291 4096 |
|
1292 Contains copy information. This revision changes files in a way that |
|
1293 could affect copy tracing. This does *not* affect changegroup handling, |
|
1294 but is relevant for other parts of Mercurial. |
|
1295 |
1281 For historical reasons, the integer values are identical to revlog version |
1296 For historical reasons, the integer values are identical to revlog version |
1282 1 per-revision storage flags and correspond to bits being set in this |
1297 1 per-revision storage flags and correspond to bits being set in this |
1283 2-byte field. Bits were allocated starting from the most-significant bit, |
1298 2-byte field. Bits were allocated starting from the most-significant bit, |
1284 hence the reverse ordering and allocation of these flags. |
1299 hence the reverse ordering and allocation of these flags. |
|
1300 |
|
1301 The *pflags* (protocol flags) field holds bitwise flags affecting the |
|
1302 protocol itself. They are first in the header since they may affect the |
|
1303 handling of the rest of the fields in a future version. They are defined |
|
1304 as such: |
|
1305 |
|
1306 1 indicates whether to read a chunk of sidedata (of variable length) right |
|
1307 after the revision flags. |
1285 |
1308 |
1286 Changeset Segment |
1309 Changeset Segment |
1287 ================= |
1310 ================= |
1288 |
1311 |
1289 The *changeset segment* consists of a single *delta group* holding |
1312 The *changeset segment* consists of a single *delta group* holding |
1301 the *filelogs segment*, depending on version and the request options). |
1324 the *filelogs segment*, depending on version and the request options). |
1302 |
1325 |
1303 Treemanifests Segment |
1326 Treemanifests Segment |
1304 --------------------- |
1327 --------------------- |
1305 |
1328 |
1306 The *treemanifests segment* only exists in changegroup version "3", and |
1329 The *treemanifests segment* only exists in changegroup version "3" and |
1307 only if the 'treemanifest' param is part of the bundle2 changegroup part |
1330 "4", and only if the 'treemanifest' param is part of the bundle2 |
1308 (it is not possible to use changegroup version 3 outside of bundle2). |
1331 changegroup part (it is not possible to use changegroup version 3 or 4 |
1309 Aside from the filenames in the *treemanifests segment* containing a |
1332 outside of bundle2). Aside from the filenames in the *treemanifests |
1310 trailing "/" character, it behaves identically to the *filelogs segment* |
1333 segment* containing a trailing "/" character, it behaves identically to |
1311 (see below). The final sub-segment is followed by an *empty chunk* |
1334 the *filelogs segment* (see below). The final sub-segment is followed by |
1312 (logically, a sub-segment with filename size 0). This denotes the boundary |
1335 an *empty chunk* (logically, a sub-segment with filename size 0). This |
1313 to the *filelogs segment*. |
1336 denotes the boundary to the *filelogs segment*. |
1314 |
1337 |
1315 Filelogs Segment |
1338 Filelogs Segment |
1316 ================ |
1339 ================ |
1317 |
1340 |
1318 The *filelogs segment* consists of multiple sub-segments, each |
1341 The *filelogs segment* consists of multiple sub-segments, each |
3646 Changegroups are representations of repository revlog data, specifically |
3669 Changegroups are representations of repository revlog data, specifically |
3647 the changelog data, root/flat manifest data, treemanifest data, and |
3670 the changelog data, root/flat manifest data, treemanifest data, and |
3648 filelogs. |
3671 filelogs. |
3649 </p> |
3672 </p> |
3650 <p> |
3673 <p> |
3651 There are 3 versions of changegroups: "1", "2", and "3". From a |
3674 There are 4 versions of changegroups: "1", "2", "3" and "4". From a |
3652 high-level, versions "1" and "2" are almost exactly the same, with the |
3675 high-level, versions "1" and "2" are almost exactly the same, with the |
3653 only difference being an additional item in the *delta header*. Version |
3676 only difference being an additional item in the *delta header*. Version |
3654 "3" adds support for storage flags in the *delta header* and optionally |
3677 "3" adds support for storage flags in the *delta header* and optionally |
3655 exchanging treemanifests (enabled by setting an option on the |
3678 exchanging treemanifests (enabled by setting an option on the |
3656 "changegroup" part in the bundle2). |
3679 "changegroup" part in the bundle2). Version "4" adds support for exchanging |
|
3680 sidedata (additional revision metadata not part of the digest). |
3657 </p> |
3681 </p> |
3658 <p> |
3682 <p> |
3659 Changegroups when not exchanging treemanifests consist of 3 logical |
3683 Changegroups when not exchanging treemanifests consist of 3 logical |
3660 segments: |
3684 segments: |
3661 </p> |
3685 </p> |
3731 The *delta data* is a series of *delta*s that describe a diff from an existing |
3755 The *delta data* is a series of *delta*s that describe a diff from an existing |
3732 entry (either that the recipient already has, or previously specified in the |
3756 entry (either that the recipient already has, or previously specified in the |
3733 bundle/changegroup). |
3757 bundle/changegroup). |
3734 </p> |
3758 </p> |
3735 <p> |
3759 <p> |
3736 The *delta header* is different between versions "1", "2", and |
3760 The *delta header* is different between versions "1", "2", "3" and "4" |
3737 "3" of the changegroup format. |
3761 of the changegroup format. |
3738 </p> |
3762 </p> |
3739 <p> |
3763 <p> |
3740 Version 1 (headerlen=80): |
3764 Version 1 (headerlen=80): |
3741 </p> |
3765 </p> |
3742 <pre> |
3766 <pre> |
3768 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | |
3792 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | |
3769 | | | | | | | |
3793 | | | | | | | |
3770 +------------------------------------------------------------------------------+ |
3794 +------------------------------------------------------------------------------+ |
3771 </pre> |
3795 </pre> |
3772 <p> |
3796 <p> |
|
3797 Version 4 (headerlen=103): |
|
3798 </p> |
|
3799 <pre> |
|
3800 +------------------------------------------------------------------------------+----------+ |
|
3801 | | | | | | | | |
|
3802 | node | p1 node | p2 node | base node | link node | flags | pflags | |
|
3803 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) | |
|
3804 | | | | | | | | |
|
3805 +------------------------------------------------------------------------------+----------+ |
|
3806 </pre> |
|
3807 <p> |
3773 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which contain a |
3808 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which contain a |
3774 series of *delta*s, densely packed (no separators). These deltas describe a diff |
3809 series of *delta*s, densely packed (no separators). These deltas describe a diff |
3775 from an existing entry (either that the recipient already has, or previously |
3810 from an existing entry (either that the recipient already has, or previously |
3776 specified in the bundle/changegroup). The format is described more fully in |
3811 specified in the bundle/changegroup). The format is described more fully in |
3777 "hg help internals.bdiff", but briefly: |
3812 "hg help internals.bdiff", but briefly: |
3806 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions. |
3841 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions. |
3807 <dt>16384 |
3842 <dt>16384 |
3808 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents). |
3843 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents). |
3809 <dt>8192 |
3844 <dt>8192 |
3810 <dd>Externally stored. The revision fulltext contains "key:value" "\n" delimited metadata defining an object stored elsewhere. Used by the LFS extension. |
3845 <dd>Externally stored. The revision fulltext contains "key:value" "\n" delimited metadata defining an object stored elsewhere. Used by the LFS extension. |
|
3846 <dt>4096 |
|
3847 <dd>Contains copy information. This revision changes files in a way that could affect copy tracing. This does *not* affect changegroup handling, but is relevant for other parts of Mercurial. |
3811 </dl> |
3848 </dl> |
3812 <p> |
3849 <p> |
3813 For historical reasons, the integer values are identical to revlog version 1 |
3850 For historical reasons, the integer values are identical to revlog version 1 |
3814 per-revision storage flags and correspond to bits being set in this 2-byte |
3851 per-revision storage flags and correspond to bits being set in this 2-byte |
3815 field. Bits were allocated starting from the most-significant bit, hence the |
3852 field. Bits were allocated starting from the most-significant bit, hence the |
3816 reverse ordering and allocation of these flags. |
3853 reverse ordering and allocation of these flags. |
3817 </p> |
3854 </p> |
|
3855 <p> |
|
3856 The *pflags* (protocol flags) field holds bitwise flags affecting the protocol |
|
3857 itself. They are first in the header since they may affect the handling of the |
|
3858 rest of the fields in a future version. They are defined as such: |
|
3859 </p> |
|
3860 <dl> |
|
3861 <dt>1 indicates whether to read a chunk of sidedata (of variable length) right |
|
3862 <dd>after the revision flags. |
|
3863 </dl> |
3818 <h2>Changeset Segment</h2> |
3864 <h2>Changeset Segment</h2> |
3819 <p> |
3865 <p> |
3820 The *changeset segment* consists of a single *delta group* holding |
3866 The *changeset segment* consists of a single *delta group* holding |
3821 changelog data. The *empty chunk* at the end of the *delta group* denotes |
3867 changelog data. The *empty chunk* at the end of the *delta group* denotes |
3822 the boundary to the *manifest segment*. |
3868 the boundary to the *manifest segment*. |
3830 the boundary to the next segment (either the *treemanifests segment* or the |
3876 the boundary to the next segment (either the *treemanifests segment* or the |
3831 *filelogs segment*, depending on version and the request options). |
3877 *filelogs segment*, depending on version and the request options). |
3832 </p> |
3878 </p> |
3833 <h3>Treemanifests Segment</h3> |
3879 <h3>Treemanifests Segment</h3> |
3834 <p> |
3880 <p> |
3835 The *treemanifests segment* only exists in changegroup version "3", and |
3881 The *treemanifests segment* only exists in changegroup version "3" and "4", |
3836 only if the 'treemanifest' param is part of the bundle2 changegroup part |
3882 and only if the 'treemanifest' param is part of the bundle2 changegroup part |
3837 (it is not possible to use changegroup version 3 outside of bundle2). |
3883 (it is not possible to use changegroup version 3 or 4 outside of bundle2). |
3838 Aside from the filenames in the *treemanifests segment* containing a |
3884 Aside from the filenames in the *treemanifests segment* containing a |
3839 trailing "/" character, it behaves identically to the *filelogs segment* |
3885 trailing "/" character, it behaves identically to the *filelogs segment* |
3840 (see below). The final sub-segment is followed by an *empty chunk* (logically, |
3886 (see below). The final sub-segment is followed by an *empty chunk* (logically, |
3841 a sub-segment with filename size 0). This denotes the boundary to the |
3887 a sub-segment with filename size 0). This denotes the boundary to the |
3842 *filelogs segment*. |
3888 *filelogs segment*. |