Debian Codegraph @

doc/html/topic-bundlespec.html

raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
7 <title>Bundle File Formats</title>
8 <link rel="stylesheet" href="../style.css" type="text/css" />
9 </head>
10 <body>
11 <div class="document" id="bundle-file-formats">
12 <span id="topic-bundlespec"></span>
13 <h1 class="title">Bundle File Formats</h1>
14
15 <div class="contents htmlonly topic" id="contents">
16 <p class="topic-title"><a class="reference internal" href="#top">Contents</a></p>
17 <ul class="simple">
18 <li><a class="reference internal" href="#available-types" id="toc-entry-1">Available Types</a></li>
19 <li><a class="reference internal" href="#available-compression-engines" id="toc-entry-2">Available Compression Engines</a></li>
20 <li><a class="reference internal" href="#available-options" id="toc-entry-3">Available Options</a></li>
21 <li><a class="reference internal" href="#examples" id="toc-entry-4">Examples</a></li>
22 </ul>
23 </div>
24 <p id="bundlespec">Mercurial supports generating standalone &quot;bundle&quot; files that hold repository
25 data. These &quot;bundles&quot; are typically saved locally and used later or exchanged
26 between different repositories, possibly on different machines. Example
27 commands using bundles are <a class="reference external" href="hg-bundle.html"><tt class="docutils literal">hg bundle</tt></a> and <a class="reference external" href="hg-unbundle.html"><tt class="docutils literal">hg unbundle</tt></a>.</p>
28 <p>Generation of bundle files is controlled by a &quot;bundle specification&quot;
29 (&quot;bundlespec&quot;) string. This string tells the bundle generation process how
30 to create the bundle.</p>
31 <p>A &quot;bundlespec&quot; string is composed of the following elements:</p>
32 <dl class="docutils">
33 <dt>type</dt>
34 <dd>A string denoting the bundle format to use.</dd>
35 <dt>compression</dt>
36 <dd>Denotes the compression engine to use compressing the raw bundle data.</dd>
37 <dt>parameters</dt>
38 <dd>Arbitrary key-value parameters to further control bundle generation.</dd>
39 </dl>
40 <p>A &quot;bundlespec&quot; string has the following formats:</p>
41 <dl class="docutils">
42 <dt>&lt;type&gt;</dt>
43 <dd>The literal bundle format string is used.</dd>
44 <dt>&lt;compression&gt;-&lt;type&gt;</dt>
45 <dd>The compression engine and format are delimited by a hyphen (<tt class="docutils literal">-</tt>).</dd>
46 </dl>
47 <p>Optional parameters follow the <tt class="docutils literal">&lt;type&gt;</tt>. Parameters are URI escaped
48 <tt class="docutils literal">key=value</tt> pairs. Each pair is delimited by a semicolon (<tt class="docutils literal">;</tt>). The
49 first parameter begins after a <tt class="docutils literal">;</tt> immediately following the <tt class="docutils literal">&lt;type&gt;</tt>
50 value.</p>
51 <div class="section" id="available-types">
52 <h1><a class="toc-backref" href="#contents">Available Types</a></h1>
53 <p>The following bundle &lt;type&gt; strings are available:</p>
54 <dl class="docutils">
55 <dt>v1</dt>
56 <dd><p class="first">Produces a legacy &quot;changegroup&quot; version 1 bundle.</p>
57 <p>This format is compatible with nearly all Mercurial clients because it is
58 the oldest. However, it has some limitations, which is why it is no longer
59 the default for new repositories.</p>
60 <p><tt class="docutils literal">v1</tt> bundles can be used with modern repositories using the &quot;generaldelta&quot;
61 storage format. However, it may take longer to produce the bundle and the
62 resulting bundle may be significantly larger than a <tt class="docutils literal">v2</tt> bundle.</p>
63 <p class="last"><tt class="docutils literal">v1</tt> bundles can only use the <tt class="docutils literal">gzip</tt>, <tt class="docutils literal">bzip2</tt>, and <tt class="docutils literal">none</tt> compression
64 formats.</p>
65 </dd>
66 <dt>v2</dt>
67 <dd><p class="first">Produces a version 2 bundle.</p>
68 <p>Version 2 bundles are an extensible format that can store additional
69 repository data (such as bookmarks and phases information) and they can
70 store data more efficiently, resulting in smaller bundles.</p>
71 <p class="last">Version 2 bundles can also use modern compression engines, such as
72 <tt class="docutils literal">zstd</tt>, making them faster to compress and often smaller.</p>
73 </dd>
74 </dl>
75 </div>
76 <div class="section" id="available-compression-engines">
77 <h1><a class="toc-backref" href="#contents">Available Compression Engines</a></h1>
78 <p>The following bundle &lt;compression&gt; engines can be used:</p>
79 <dl class="docutils">
80 <dt><tt class="docutils literal">bzip2</tt></dt>
81 <dd><p class="first">An algorithm that produces smaller bundles than <tt class="docutils literal">gzip</tt>.</p>
82 <p>All Mercurial clients should support this format.</p>
83 <p>This engine will likely produce smaller bundles than <tt class="docutils literal">gzip</tt> but
84 will be significantly slower, both during compression and
85 decompression.</p>
86 <p class="last">If available, the <tt class="docutils literal">zstd</tt> engine can yield similar or better
87 compression at much higher speeds.</p>
88 </dd>
89 <dt><tt class="docutils literal">gzip</tt></dt>
90 <dd><p class="first">zlib compression using the DEFLATE algorithm.</p>
91 <p class="last">All Mercurial clients should support this format. The compression
92 algorithm strikes a reasonable balance between compression ratio
93 and size.</p>
94 </dd>
95 <dt><tt class="docutils literal">none</tt></dt>
96 <dd><p class="first">No compression is performed.</p>
97 <p class="last">Use this compression engine to explicitly disable compression.</p>
98 </dd>
99 </dl>
100 <p>The compression engines can be prepended with <tt class="docutils literal">stream</tt> to create a streaming bundle.
101 These are bundles that are extremely efficient to produce and consume,
102 but do not have guaranteed compatibility with older clients.</p>
103 </div>
104 <div class="section" id="available-options">
105 <h1><a class="toc-backref" href="#contents">Available Options</a></h1>
106 <p>The following options exist:</p>
107 <dl class="docutils">
108 <dt>changegroup</dt>
109 <dd>Include the changegroup data in the bundle (default to True).</dd>
110 <dt>cg.version</dt>
111 <dd>Select the version of the changegroup to use. Available options are : 01,
112 02, 03, or 04. By default it will be automatically selected according to the
113 current repository format.</dd>
114 <dt>cg.delta-compression</dt>
115 <dd><p class="first">Starting with <cite>cg.version</cite> &quot;04&quot;, changegroups can include pre-compressed
116 deltas that the receiving end might reuse as-is. If this option is omitted,
117 no such delta will be part of the changegroup. The option accepts a
118 comma-separated list of accepted compression formats. Supported format are:</p>
119 <ul class="last simple">
120 <li><dl class="first docutils">
121 <dt>none: delta explicitly non-compressed (useful to prevent the receiver from</dt>
122 <dd>even trying to compress such deltas)</dd>
123 </dl>
124 </li>
125 <li>zlib: zlib-compressed delta</li>
126 <li>zstd: zstd-compressed delta</li>
127 </ul>
128 </dd>
129 <dt>obsolescence</dt>
130 <dd>Include obsolescence-markers relevant to the bundled changesets.</dd>
131 <dt>phases</dt>
132 <dd>Include phase information relevant to the bundled changesets.</dd>
133 <dt>revbranchcache</dt>
134 <dd>Include the &quot;rev-branch&quot; cache inside the bundle.</dd>
135 <dt>tagsfnodescache</dt>
136 <dd>Include the &quot;tags-fnodes&quot; cache inside the bundle.</dd>
137 </dl>
138 </div>
139 <div class="section" id="examples">
140 <h1><a class="toc-backref" href="#contents">Examples</a></h1>
141 <dl class="docutils">
142 <dt><tt class="docutils literal">v2</tt></dt>
143 <dd>Produce a <tt class="docutils literal">v2</tt> bundle using default options, including compression.</dd>
144 <dt><tt class="docutils literal"><span class="pre">none-v1</span></tt></dt>
145 <dd>Produce a <tt class="docutils literal">v1</tt> bundle with no compression.</dd>
146 <dt><tt class="docutils literal"><span class="pre">zstd-v2</span></tt></dt>
147 <dd>Produce a <tt class="docutils literal">v2</tt> bundle with zstandard compression using default
148 settings.</dd>
149 <dt><tt class="docutils literal"><span class="pre">zstd-v1</span></tt></dt>
150 <dd>This errors because <tt class="docutils literal">zstd</tt> is not supported for <tt class="docutils literal">v1</tt> types.</dd>
151 <dt><tt class="docutils literal"><span class="pre">none-streamv2</span></tt></dt>
152 <dd>Produce a <tt class="docutils literal">v2</tt> streaming bundle with no compression.</dd>
153 <dt><tt class="docutils literal"><span class="pre">zstd-v2;obsolescence=true;phases=true</span></tt></dt>
154 <dd>Produce a <tt class="docutils literal">v2</tt> bundle with zstandard compression which includes
155 obsolescence markers and phases.</dd>
156 </dl>
157 </div>
158 </div>
159 </body>
160 </html>