##// END OF EJS Templates
help: add documentation for bundle types...
Gregory Szorc -
r27373:84784f83 default
parent child Browse files
Show More
@@ -0,0 +1,97 b''
1 Bundles
2 =======
3
4 A bundle is a container for repository data.
5
6 Bundles are used as standalone files as well as the interchange format
7 over the wire protocol used when two Mercurial peers communicate with
8 each other.
9
10 Headers
11 -------
12
13 Bundles produced since Mercurial 0.7 (September 2005) have a 4 byte
14 header identifying the major bundle type. The header always begins with
15 ``HG`` and the follow 2 bytes indicate the bundle type/version. Some
16 bundle types have additional data after this 4 byte header.
17
18 The following sections describe each bundle header/type.
19
20 HG10
21 ----
22
23 ``HG10`` headers indicate a *changegroup bundle*. This is the original
24 bundle format, so it is sometimes referred to as *bundle1*. It has been
25 present since version 0.7 (released September 2005).
26
27 This header is followed by 2 bytes indicating the compression algorithm
28 used for data that follows. All subsequent data following this
29 compression identifier is compressed according to the algorithm/method
30 specified.
31
32 Supported algorithms include the following.
33
34 ``BZ``
35 *bzip2* compression.
36
37 Bzip2 compressors emit a leading ``BZ`` header. Mercurial uses this
38 leading ``BZ`` as part of the bundle header. Therefore consumers
39 of bzip2 bundles need to *seed* the bzip2 decompressor with ``BZ`` or
40 seek the input stream back to the beginning of the algorithm component
41 of the bundle header so that decompressor input is valid. This behavior
42 is unique among supported compression algorithms.
43
44 Supported since version 0.7 (released December 2006).
45
46 ``GZ``
47 *zlib* compression.
48
49 Supported since version 0.9.2 (released December 2006).
50
51 ``UN``
52 *Uncompressed* or no compression. Unmodified changegroup data follows.
53
54 Supported since version 0.9.2 (released December 2006).
55
56 3rd party extensions may implement their own compression. However, no
57 authority reserves values for their compression algorithm identifiers.
58
59 HG2X
60 ----
61
62 ``HG2X`` headers (where ``X`` is any value) denote a *bundle2* bundle.
63 Bundle2 bundles are a container format for various kinds of repository
64 data and capabilities, beyond changegroup data (which was the only data
65 supported by ``HG10`` bundles.
66
67 ``HG20`` is currently the only defined bundle2 version.
68
69 The ``HG20`` format is not yet documented here. See the inline comments
70 in ``mercurial/exchange.py`` for now.
71
72 Initial ``HG20`` support was added in Mercurial 3.0 (released May
73 2014). However, bundle2 bundles were hidden behind an experimental flag
74 until version 3.5 (released August 2015), when they were enabled in the
75 wire protocol. Various commands (including ``hg bundle``) did not
76 support generating bundle2 files until Mercurial 3.6 (released November
77 2015).
78
79 HGS1
80 ----
81
82 *Experimental*
83
84 A ``HGS1`` header indicates a *streaming clone bundle*. This is a bundle
85 that contains raw revlog data from a repository store. (Typically revlog
86 data is exchanged in the form of changegroups.)
87
88 The purpose of *streaming clone bundles* are to *clone* repository data
89 very efficiently.
90
91 The ``HGS1`` header is always followed by 2 bytes indicating a
92 compression algorithm of the data that follows. Only ``UN``
93 (uncompressed data) is currently allowed.
94
95 ``HGS1UN`` support was added as an experimental feature in version 3.6
96 (released November 2015) as part of the initial offering of the *clone
97 bundles* feature.
General Comments 0
You need to be logged in to leave comments. Login now