Differences between revisions 1 and 2
Revision 1 as of 2011-05-11 12:24:36
Size: 2108
Editor: cyanite
Comment: initial version
Revision 2 as of 2011-05-11 12:32:00
Size: 2306
Editor: cyanite
Comment:
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
For each section, the offsets are given relative to the beginning of the section. Fields with unknown length are assigned constants a, b, c etc.
Line 17: Line 19:
||<)> 6 ||<)> a || string || Bundle features (or requirements). A list of comma separated words (lowercase ASCII) describing features present in the bundle. The string is terminated by a newline character. || ||<)> 6 ||<)> 4 || uint || Length of feature string, in bytes. ||
||<)> 10 ||<)> a || string || Bundle features (or requirements). A list of newline separated strings describing features present in the bundle (unterminated). ||
Line 33: Line 36:
||<)> 4 ||<)> 4 || uint || Length of filename. || ||<)> 4 ||<)> 4 || uint || Length of filename, in bytes. ||

This page describes the second iteration of the bundle format, tentatively called HG19 (since we hope to include it with Mercurial 1.9).

Bundles consist of the following sections:

  • A bundle header, describing the version and features present in the data.
  • Changegroup sections for the changelog, the manifest and each relevant filelog.
  • Optionally, a footer containing an index for more efficient random access?

Sections

For each section, the offsets are given relative to the beginning of the section. Fields with unknown length are assigned constants a, b, c etc.

The bundle header has the following format:

Offset

Size

Type

Description

0

4

string

Bundle format version. Always contains "HG19".

4

2

string

Compression type. Either "BZ", "GZ" or "UN".

6

4

uint

Length of feature string, in bytes.

10

a

string

Bundle features (or requirements). A list of newline separated strings describing features present in the bundle (unterminated).

Changegroup sections

The changegroup sections has the following format:

Offset

Size

Type

Description

0

4

uint

Number of changelog entries.

4

b

group

Changegroup containing changelog entries.

b + 4

4

uint

Number of manifest entries.

b + 8

c

group

Changegroup containing manifest entries.

b + c + 8

4

uint

Number of filelog changegroups (note: not the number of entries).

Then, for each filelog, the following:

Offset

Size

Type

Description

0

4

uint

Number of filelog entries.

4

4

uint

Length of filename, in bytes.

8

d

string

Filename (unterminated).

d + 8

e

group

Changroup containing filelog entries.

Changegroups

...

BundleFormat2 (last edited 2018-02-10 00:05:58 by AviKelman)