##// END OF EJS Templates
clone-bundles: add a command to clear all bundles
marmoute -
r51306:10318b88 default
parent child Browse files
Show More
@@ -1,979 +1,996 b''
1 # This software may be used and distributed according to the terms of the
1 # This software may be used and distributed according to the terms of the
2 # GNU General Public License version 2 or any later version.
2 # GNU General Public License version 2 or any later version.
3
3
4 """advertise pre-generated bundles to seed clones
4 """advertise pre-generated bundles to seed clones
5
5
6 "clonebundles" is a server-side extension used to advertise the existence
6 "clonebundles" is a server-side extension used to advertise the existence
7 of pre-generated, externally hosted bundle files to clients that are
7 of pre-generated, externally hosted bundle files to clients that are
8 cloning so that cloning can be faster, more reliable, and require less
8 cloning so that cloning can be faster, more reliable, and require less
9 resources on the server. "pullbundles" is a related feature for sending
9 resources on the server. "pullbundles" is a related feature for sending
10 pre-generated bundle files to clients as part of pull operations.
10 pre-generated bundle files to clients as part of pull operations.
11
11
12 Cloning can be a CPU and I/O intensive operation on servers. Traditionally,
12 Cloning can be a CPU and I/O intensive operation on servers. Traditionally,
13 the server, in response to a client's request to clone, dynamically generates
13 the server, in response to a client's request to clone, dynamically generates
14 a bundle containing the entire repository content and sends it to the client.
14 a bundle containing the entire repository content and sends it to the client.
15 There is no caching on the server and the server will have to redundantly
15 There is no caching on the server and the server will have to redundantly
16 generate the same outgoing bundle in response to each clone request. For
16 generate the same outgoing bundle in response to each clone request. For
17 servers with large repositories or with high clone volume, the load from
17 servers with large repositories or with high clone volume, the load from
18 clones can make scaling the server challenging and costly.
18 clones can make scaling the server challenging and costly.
19
19
20 This extension provides server operators the ability to offload
20 This extension provides server operators the ability to offload
21 potentially expensive clone load to an external service. Pre-generated
21 potentially expensive clone load to an external service. Pre-generated
22 bundles also allow using more CPU intensive compression, reducing the
22 bundles also allow using more CPU intensive compression, reducing the
23 effective bandwidth requirements.
23 effective bandwidth requirements.
24
24
25 Here's how clone bundles work:
25 Here's how clone bundles work:
26
26
27 1. A server operator establishes a mechanism for making bundle files available
27 1. A server operator establishes a mechanism for making bundle files available
28 on a hosting service where Mercurial clients can fetch them.
28 on a hosting service where Mercurial clients can fetch them.
29 2. A manifest file listing available bundle URLs and some optional metadata
29 2. A manifest file listing available bundle URLs and some optional metadata
30 is added to the Mercurial repository on the server.
30 is added to the Mercurial repository on the server.
31 3. A client initiates a clone against a clone bundles aware server.
31 3. A client initiates a clone against a clone bundles aware server.
32 4. The client sees the server is advertising clone bundles and fetches the
32 4. The client sees the server is advertising clone bundles and fetches the
33 manifest listing available bundles.
33 manifest listing available bundles.
34 5. The client filters and sorts the available bundles based on what it
34 5. The client filters and sorts the available bundles based on what it
35 supports and prefers.
35 supports and prefers.
36 6. The client downloads and applies an available bundle from the
36 6. The client downloads and applies an available bundle from the
37 server-specified URL.
37 server-specified URL.
38 7. The client reconnects to the original server and performs the equivalent
38 7. The client reconnects to the original server and performs the equivalent
39 of :hg:`pull` to retrieve all repository data not in the bundle. (The
39 of :hg:`pull` to retrieve all repository data not in the bundle. (The
40 repository could have been updated between when the bundle was created
40 repository could have been updated between when the bundle was created
41 and when the client started the clone.) This may use "pullbundles".
41 and when the client started the clone.) This may use "pullbundles".
42
42
43 Instead of the server generating full repository bundles for every clone
43 Instead of the server generating full repository bundles for every clone
44 request, it generates full bundles once and they are subsequently reused to
44 request, it generates full bundles once and they are subsequently reused to
45 bootstrap new clones. The server may still transfer data at clone time.
45 bootstrap new clones. The server may still transfer data at clone time.
46 However, this is only data that has been added/changed since the bundle was
46 However, this is only data that has been added/changed since the bundle was
47 created. For large, established repositories, this can reduce server load for
47 created. For large, established repositories, this can reduce server load for
48 clones to less than 1% of original.
48 clones to less than 1% of original.
49
49
50 Here's how pullbundles work:
50 Here's how pullbundles work:
51
51
52 1. A manifest file listing available bundles and describing the revisions
52 1. A manifest file listing available bundles and describing the revisions
53 is added to the Mercurial repository on the server.
53 is added to the Mercurial repository on the server.
54 2. A new-enough client informs the server that it supports partial pulls
54 2. A new-enough client informs the server that it supports partial pulls
55 and initiates a pull.
55 and initiates a pull.
56 3. If the server has pull bundles enabled and sees the client advertising
56 3. If the server has pull bundles enabled and sees the client advertising
57 partial pulls, it checks for a matching pull bundle in the manifest.
57 partial pulls, it checks for a matching pull bundle in the manifest.
58 A bundle matches if the format is supported by the client, the client
58 A bundle matches if the format is supported by the client, the client
59 has the required revisions already and needs something from the bundle.
59 has the required revisions already and needs something from the bundle.
60 4. If there is at least one matching bundle, the server sends it to the client.
60 4. If there is at least one matching bundle, the server sends it to the client.
61 5. The client applies the bundle and notices that the server reply was
61 5. The client applies the bundle and notices that the server reply was
62 incomplete. It initiates another pull.
62 incomplete. It initiates another pull.
63
63
64 To work, this extension requires the following of server operators:
64 To work, this extension requires the following of server operators:
65
65
66 * Generating bundle files of repository content (typically periodically,
66 * Generating bundle files of repository content (typically periodically,
67 such as once per day).
67 such as once per day).
68 * Clone bundles: A file server that clients have network access to and that
68 * Clone bundles: A file server that clients have network access to and that
69 Python knows how to talk to through its normal URL handling facility
69 Python knows how to talk to through its normal URL handling facility
70 (typically an HTTP/HTTPS server).
70 (typically an HTTP/HTTPS server).
71 * A process for keeping the bundles manifest in sync with available bundle
71 * A process for keeping the bundles manifest in sync with available bundle
72 files.
72 files.
73
73
74 Strictly speaking, using a static file hosting server isn't required: a server
74 Strictly speaking, using a static file hosting server isn't required: a server
75 operator could use a dynamic service for retrieving bundle data. However,
75 operator could use a dynamic service for retrieving bundle data. However,
76 static file hosting services are simple and scalable and should be sufficient
76 static file hosting services are simple and scalable and should be sufficient
77 for most needs.
77 for most needs.
78
78
79 Bundle files can be generated with the :hg:`bundle` command. Typically
79 Bundle files can be generated with the :hg:`bundle` command. Typically
80 :hg:`bundle --all` is used to produce a bundle of the entire repository.
80 :hg:`bundle --all` is used to produce a bundle of the entire repository.
81
81
82 :hg:`debugcreatestreamclonebundle` can be used to produce a special
82 :hg:`debugcreatestreamclonebundle` can be used to produce a special
83 *streaming clonebundle*. These are bundle files that are extremely efficient
83 *streaming clonebundle*. These are bundle files that are extremely efficient
84 to produce and consume (read: fast). However, they are larger than
84 to produce and consume (read: fast). However, they are larger than
85 traditional bundle formats and require that clients support the exact set
85 traditional bundle formats and require that clients support the exact set
86 of repository data store formats in use by the repository that created them.
86 of repository data store formats in use by the repository that created them.
87 Typically, a newer server can serve data that is compatible with older clients.
87 Typically, a newer server can serve data that is compatible with older clients.
88 However, *streaming clone bundles* don't have this guarantee. **Server
88 However, *streaming clone bundles* don't have this guarantee. **Server
89 operators need to be aware that newer versions of Mercurial may produce
89 operators need to be aware that newer versions of Mercurial may produce
90 streaming clone bundles incompatible with older Mercurial versions.**
90 streaming clone bundles incompatible with older Mercurial versions.**
91
91
92 A server operator is responsible for creating a ``.hg/clonebundles.manifest``
92 A server operator is responsible for creating a ``.hg/clonebundles.manifest``
93 file containing the list of available bundle files suitable for seeding
93 file containing the list of available bundle files suitable for seeding
94 clones. If this file does not exist, the repository will not advertise the
94 clones. If this file does not exist, the repository will not advertise the
95 existence of clone bundles when clients connect. For pull bundles,
95 existence of clone bundles when clients connect. For pull bundles,
96 ``.hg/pullbundles.manifest`` is used.
96 ``.hg/pullbundles.manifest`` is used.
97
97
98 The manifest file contains a newline (\\n) delimited list of entries.
98 The manifest file contains a newline (\\n) delimited list of entries.
99
99
100 Each line in this file defines an available bundle. Lines have the format:
100 Each line in this file defines an available bundle. Lines have the format:
101
101
102 <URL> [<key>=<value>[ <key>=<value>]]
102 <URL> [<key>=<value>[ <key>=<value>]]
103
103
104 That is, a URL followed by an optional, space-delimited list of key=value
104 That is, a URL followed by an optional, space-delimited list of key=value
105 pairs describing additional properties of this bundle. Both keys and values
105 pairs describing additional properties of this bundle. Both keys and values
106 are URI encoded.
106 are URI encoded.
107
107
108 For pull bundles, the URL is a path under the ``.hg`` directory of the
108 For pull bundles, the URL is a path under the ``.hg`` directory of the
109 repository.
109 repository.
110
110
111 Keys in UPPERCASE are reserved for use by Mercurial and are defined below.
111 Keys in UPPERCASE are reserved for use by Mercurial and are defined below.
112 All non-uppercase keys can be used by site installations. An example use
112 All non-uppercase keys can be used by site installations. An example use
113 for custom properties is to use the *datacenter* attribute to define which
113 for custom properties is to use the *datacenter* attribute to define which
114 data center a file is hosted in. Clients could then prefer a server in the
114 data center a file is hosted in. Clients could then prefer a server in the
115 data center closest to them.
115 data center closest to them.
116
116
117 The following reserved keys are currently defined:
117 The following reserved keys are currently defined:
118
118
119 BUNDLESPEC
119 BUNDLESPEC
120 A "bundle specification" string that describes the type of the bundle.
120 A "bundle specification" string that describes the type of the bundle.
121
121
122 These are string values that are accepted by the "--type" argument of
122 These are string values that are accepted by the "--type" argument of
123 :hg:`bundle`.
123 :hg:`bundle`.
124
124
125 The values are parsed in strict mode, which means they must be of the
125 The values are parsed in strict mode, which means they must be of the
126 "<compression>-<type>" form. See
126 "<compression>-<type>" form. See
127 mercurial.exchange.parsebundlespec() for more details.
127 mercurial.exchange.parsebundlespec() for more details.
128
128
129 :hg:`debugbundle --spec` can be used to print the bundle specification
129 :hg:`debugbundle --spec` can be used to print the bundle specification
130 string for a bundle file. The output of this command can be used verbatim
130 string for a bundle file. The output of this command can be used verbatim
131 for the value of ``BUNDLESPEC`` (it is already escaped).
131 for the value of ``BUNDLESPEC`` (it is already escaped).
132
132
133 Clients will automatically filter out specifications that are unknown or
133 Clients will automatically filter out specifications that are unknown or
134 unsupported so they won't attempt to download something that likely won't
134 unsupported so they won't attempt to download something that likely won't
135 apply.
135 apply.
136
136
137 The actual value doesn't impact client behavior beyond filtering:
137 The actual value doesn't impact client behavior beyond filtering:
138 clients will still sniff the bundle type from the header of downloaded
138 clients will still sniff the bundle type from the header of downloaded
139 files.
139 files.
140
140
141 **Use of this key is highly recommended**, as it allows clients to
141 **Use of this key is highly recommended**, as it allows clients to
142 easily skip unsupported bundles. If this key is not defined, an old
142 easily skip unsupported bundles. If this key is not defined, an old
143 client may attempt to apply a bundle that it is incapable of reading.
143 client may attempt to apply a bundle that it is incapable of reading.
144
144
145 REQUIRESNI
145 REQUIRESNI
146 Whether Server Name Indication (SNI) is required to connect to the URL.
146 Whether Server Name Indication (SNI) is required to connect to the URL.
147 SNI allows servers to use multiple certificates on the same IP. It is
147 SNI allows servers to use multiple certificates on the same IP. It is
148 somewhat common in CDNs and other hosting providers. Older Python
148 somewhat common in CDNs and other hosting providers. Older Python
149 versions do not support SNI. Defining this attribute enables clients
149 versions do not support SNI. Defining this attribute enables clients
150 with older Python versions to filter this entry without experiencing
150 with older Python versions to filter this entry without experiencing
151 an opaque SSL failure at connection time.
151 an opaque SSL failure at connection time.
152
152
153 If this is defined, it is important to advertise a non-SNI fallback
153 If this is defined, it is important to advertise a non-SNI fallback
154 URL or clients running old Python releases may not be able to clone
154 URL or clients running old Python releases may not be able to clone
155 with the clonebundles facility.
155 with the clonebundles facility.
156
156
157 Value should be "true".
157 Value should be "true".
158
158
159 REQUIREDRAM
159 REQUIREDRAM
160 Value specifies expected memory requirements to decode the payload.
160 Value specifies expected memory requirements to decode the payload.
161 Values can have suffixes for common bytes sizes. e.g. "64MB".
161 Values can have suffixes for common bytes sizes. e.g. "64MB".
162
162
163 This key is often used with zstd-compressed bundles using a high
163 This key is often used with zstd-compressed bundles using a high
164 compression level / window size, which can require 100+ MB of memory
164 compression level / window size, which can require 100+ MB of memory
165 to decode.
165 to decode.
166
166
167 heads
167 heads
168 Used for pull bundles. This contains the ``;`` separated changeset
168 Used for pull bundles. This contains the ``;`` separated changeset
169 hashes of the heads of the bundle content.
169 hashes of the heads of the bundle content.
170
170
171 bases
171 bases
172 Used for pull bundles. This contains the ``;`` separated changeset
172 Used for pull bundles. This contains the ``;`` separated changeset
173 hashes of the roots of the bundle content. This can be skipped if
173 hashes of the roots of the bundle content. This can be skipped if
174 the bundle was created without ``--base``.
174 the bundle was created without ``--base``.
175
175
176 Manifests can contain multiple entries. Assuming metadata is defined, clients
176 Manifests can contain multiple entries. Assuming metadata is defined, clients
177 will filter entries from the manifest that they don't support. The remaining
177 will filter entries from the manifest that they don't support. The remaining
178 entries are optionally sorted by client preferences
178 entries are optionally sorted by client preferences
179 (``ui.clonebundleprefers`` config option). The client then attempts
179 (``ui.clonebundleprefers`` config option). The client then attempts
180 to fetch the bundle at the first URL in the remaining list.
180 to fetch the bundle at the first URL in the remaining list.
181
181
182 **Errors when downloading a bundle will fail the entire clone operation:
182 **Errors when downloading a bundle will fail the entire clone operation:
183 clients do not automatically fall back to a traditional clone.** The reason
183 clients do not automatically fall back to a traditional clone.** The reason
184 for this is that if a server is using clone bundles, it is probably doing so
184 for this is that if a server is using clone bundles, it is probably doing so
185 because the feature is necessary to help it scale. In other words, there
185 because the feature is necessary to help it scale. In other words, there
186 is an assumption that clone load will be offloaded to another service and
186 is an assumption that clone load will be offloaded to another service and
187 that the Mercurial server isn't responsible for serving this clone load.
187 that the Mercurial server isn't responsible for serving this clone load.
188 If that other service experiences issues and clients start mass falling back to
188 If that other service experiences issues and clients start mass falling back to
189 the original Mercurial server, the added clone load could overwhelm the server
189 the original Mercurial server, the added clone load could overwhelm the server
190 due to unexpected load and effectively take it offline. Not having clients
190 due to unexpected load and effectively take it offline. Not having clients
191 automatically fall back to cloning from the original server mitigates this
191 automatically fall back to cloning from the original server mitigates this
192 scenario.
192 scenario.
193
193
194 Because there is no automatic Mercurial server fallback on failure of the
194 Because there is no automatic Mercurial server fallback on failure of the
195 bundle hosting service, it is important for server operators to view the bundle
195 bundle hosting service, it is important for server operators to view the bundle
196 hosting service as an extension of the Mercurial server in terms of
196 hosting service as an extension of the Mercurial server in terms of
197 availability and service level agreements: if the bundle hosting service goes
197 availability and service level agreements: if the bundle hosting service goes
198 down, so does the ability for clients to clone. Note: clients will see a
198 down, so does the ability for clients to clone. Note: clients will see a
199 message informing them how to bypass the clone bundles facility when a failure
199 message informing them how to bypass the clone bundles facility when a failure
200 occurs. So server operators should prepare for some people to follow these
200 occurs. So server operators should prepare for some people to follow these
201 instructions when a failure occurs, thus driving more load to the original
201 instructions when a failure occurs, thus driving more load to the original
202 Mercurial server when the bundle hosting service fails.
202 Mercurial server when the bundle hosting service fails.
203
203
204
204
205 auto-generation of clone bundles
205 auto-generation of clone bundles
206 --------------------------------
206 --------------------------------
207
207
208 It is possible to set Mercurial to automatically re-generate clone bundles when
208 It is possible to set Mercurial to automatically re-generate clone bundles when
209 enough new content is available.
209 enough new content is available.
210
210
211 Mercurial will take care of the process asynchronously. The defined list of
211 Mercurial will take care of the process asynchronously. The defined list of
212 bundle-type will be generated, uploaded, and advertised. Older bundles will get
212 bundle-type will be generated, uploaded, and advertised. Older bundles will get
213 decommissioned as newer ones replace them.
213 decommissioned as newer ones replace them.
214
214
215 Bundles Generation:
215 Bundles Generation:
216 ...................
216 ...................
217
217
218 The extension can generate multiple variants of the clone bundle. Each
218 The extension can generate multiple variants of the clone bundle. Each
219 different variant will be defined by the "bundle-spec" they use::
219 different variant will be defined by the "bundle-spec" they use::
220
220
221 [clone-bundles]
221 [clone-bundles]
222 auto-generate.formats= zstd-v2, gzip-v2
222 auto-generate.formats= zstd-v2, gzip-v2
223
223
224 See `hg help bundlespec` for details about available options.
224 See `hg help bundlespec` for details about available options.
225
225
226 By default, new bundles are generated when 5% of the repository contents or at
226 By default, new bundles are generated when 5% of the repository contents or at
227 least 1000 revisions are not contained in the cached bundles. This option can
227 least 1000 revisions are not contained in the cached bundles. This option can
228 be controlled by the `clone-bundles.trigger.below-bundled-ratio` option
228 be controlled by the `clone-bundles.trigger.below-bundled-ratio` option
229 (default 0.95) and the `clone-bundles.trigger.revs` option (default 1000)::
229 (default 0.95) and the `clone-bundles.trigger.revs` option (default 1000)::
230
230
231 [clone-bundles]
231 [clone-bundles]
232 trigger.below-bundled-ratio=0.95
232 trigger.below-bundled-ratio=0.95
233 trigger.revs=1000
233 trigger.revs=1000
234
234
235 This logic can be manually triggered using the `admin::clone-bundles-refresh`
235 This logic can be manually triggered using the `admin::clone-bundles-refresh`
236 command, or automatically on each repository change if
236 command, or automatically on each repository change if
237 `clone-bundles.auto-generate.on-change` is set to `yes`.
237 `clone-bundles.auto-generate.on-change` is set to `yes`.
238
238
239 [clone-bundles]
239 [clone-bundles]
240 auto-generate.on-change=yes
240 auto-generate.on-change=yes
241 auto-generate.formats= zstd-v2, gzip-v2
241 auto-generate.formats= zstd-v2, gzip-v2
242
242
243 Bundles Upload and Serving:
243 Bundles Upload and Serving:
244 ...........................
244 ...........................
245
245
246 The generated bundles need to be made available to users through a "public" URL.
246 The generated bundles need to be made available to users through a "public" URL.
247 This should be donne through `clone-bundles.upload-command` configuration. The
247 This should be donne through `clone-bundles.upload-command` configuration. The
248 value of this command should be a shell command. It will have access to the
248 value of this command should be a shell command. It will have access to the
249 bundle file path through the `$HGCB_BUNDLE_PATH` variable. And the expected
249 bundle file path through the `$HGCB_BUNDLE_PATH` variable. And the expected
250 basename in the "public" URL is accessible at::
250 basename in the "public" URL is accessible at::
251
251
252 [clone-bundles]
252 [clone-bundles]
253 upload-command=sftp put $HGCB_BUNDLE_PATH \
253 upload-command=sftp put $HGCB_BUNDLE_PATH \
254 sftp://bundles.host/clone-bundles/$HGCB_BUNDLE_BASENAME
254 sftp://bundles.host/clone-bundles/$HGCB_BUNDLE_BASENAME
255
255
256 If the file was already uploaded, the command must still succeed.
256 If the file was already uploaded, the command must still succeed.
257
257
258 After upload, the file should be available at an url defined by
258 After upload, the file should be available at an url defined by
259 `clone-bundles.url-template`.
259 `clone-bundles.url-template`.
260
260
261 [clone-bundles]
261 [clone-bundles]
262 url-template=https://bundles.host/cache/clone-bundles/{basename}
262 url-template=https://bundles.host/cache/clone-bundles/{basename}
263
263
264 Old bundles cleanup:
264 Old bundles cleanup:
265 ....................
265 ....................
266
266
267 When new bundles are generated, the older ones are no longer necessary and can
267 When new bundles are generated, the older ones are no longer necessary and can
268 be removed from storage. This is done through the `clone-bundles.delete-command`
268 be removed from storage. This is done through the `clone-bundles.delete-command`
269 configuration. The command is given the url of the artifact to delete through
269 configuration. The command is given the url of the artifact to delete through
270 the `$HGCB_BUNDLE_URL` environment variable.
270 the `$HGCB_BUNDLE_URL` environment variable.
271
271
272 [clone-bundles]
272 [clone-bundles]
273 delete-command=sftp rm sftp://bundles.host/clone-bundles/$HGCB_BUNDLE_BASENAME
273 delete-command=sftp rm sftp://bundles.host/clone-bundles/$HGCB_BUNDLE_BASENAME
274
274
275 If the file was already deleted, the command must still succeed.
275 If the file was already deleted, the command must still succeed.
276 """
276 """
277
277
278
278
279 import os
279 import os
280 import weakref
280 import weakref
281
281
282 from mercurial.i18n import _
282 from mercurial.i18n import _
283
283
284 from mercurial import (
284 from mercurial import (
285 bundlecaches,
285 bundlecaches,
286 commands,
286 commands,
287 error,
287 error,
288 extensions,
288 extensions,
289 localrepo,
289 localrepo,
290 lock,
290 lock,
291 node,
291 node,
292 registrar,
292 registrar,
293 util,
293 util,
294 wireprotov1server,
294 wireprotov1server,
295 )
295 )
296
296
297
297
298 from mercurial.utils import (
298 from mercurial.utils import (
299 procutil,
299 procutil,
300 )
300 )
301
301
302 testedwith = b'ships-with-hg-core'
302 testedwith = b'ships-with-hg-core'
303
303
304
304
305 def capabilities(orig, repo, proto):
305 def capabilities(orig, repo, proto):
306 caps = orig(repo, proto)
306 caps = orig(repo, proto)
307
307
308 # Only advertise if a manifest exists. This does add some I/O to requests.
308 # Only advertise if a manifest exists. This does add some I/O to requests.
309 # But this should be cheaper than a wasted network round trip due to
309 # But this should be cheaper than a wasted network round trip due to
310 # missing file.
310 # missing file.
311 if repo.vfs.exists(bundlecaches.CB_MANIFEST_FILE):
311 if repo.vfs.exists(bundlecaches.CB_MANIFEST_FILE):
312 caps.append(b'clonebundles')
312 caps.append(b'clonebundles')
313
313
314 return caps
314 return caps
315
315
316
316
317 def extsetup(ui):
317 def extsetup(ui):
318 extensions.wrapfunction(wireprotov1server, b'_capabilities', capabilities)
318 extensions.wrapfunction(wireprotov1server, b'_capabilities', capabilities)
319
319
320
320
321 # logic for bundle auto-generation
321 # logic for bundle auto-generation
322
322
323
323
324 configtable = {}
324 configtable = {}
325 configitem = registrar.configitem(configtable)
325 configitem = registrar.configitem(configtable)
326
326
327 cmdtable = {}
327 cmdtable = {}
328 command = registrar.command(cmdtable)
328 command = registrar.command(cmdtable)
329
329
330 configitem(b'clone-bundles', b'auto-generate.on-change', default=False)
330 configitem(b'clone-bundles', b'auto-generate.on-change', default=False)
331 configitem(b'clone-bundles', b'auto-generate.formats', default=list)
331 configitem(b'clone-bundles', b'auto-generate.formats', default=list)
332 configitem(b'clone-bundles', b'trigger.below-bundled-ratio', default=0.95)
332 configitem(b'clone-bundles', b'trigger.below-bundled-ratio', default=0.95)
333 configitem(b'clone-bundles', b'trigger.revs', default=1000)
333 configitem(b'clone-bundles', b'trigger.revs', default=1000)
334
334
335 configitem(b'clone-bundles', b'upload-command', default=None)
335 configitem(b'clone-bundles', b'upload-command', default=None)
336
336
337 configitem(b'clone-bundles', b'delete-command', default=None)
337 configitem(b'clone-bundles', b'delete-command', default=None)
338
338
339 configitem(b'clone-bundles', b'url-template', default=None)
339 configitem(b'clone-bundles', b'url-template', default=None)
340
340
341 configitem(b'devel', b'debug.clonebundles', default=False)
341 configitem(b'devel', b'debug.clonebundles', default=False)
342
342
343
343
344 # category for the post-close transaction hooks
344 # category for the post-close transaction hooks
345 CAT_POSTCLOSE = b"clonebundles-autobundles"
345 CAT_POSTCLOSE = b"clonebundles-autobundles"
346
346
347 # template for bundle file names
347 # template for bundle file names
348 BUNDLE_MASK = (
348 BUNDLE_MASK = (
349 b"full-%(bundle_type)s-%(revs)d_revs-%(tip_short)s_tip-%(op_id)s.hg"
349 b"full-%(bundle_type)s-%(revs)d_revs-%(tip_short)s_tip-%(op_id)s.hg"
350 )
350 )
351
351
352
352
353 # file in .hg/ use to track clonebundles being auto-generated
353 # file in .hg/ use to track clonebundles being auto-generated
354 AUTO_GEN_FILE = b'clonebundles.auto-gen'
354 AUTO_GEN_FILE = b'clonebundles.auto-gen'
355
355
356
356
357 class BundleBase(object):
357 class BundleBase(object):
358 """represents the core of properties that matters for us in a bundle
358 """represents the core of properties that matters for us in a bundle
359
359
360 :bundle_type: the bundlespec (see hg help bundlespec)
360 :bundle_type: the bundlespec (see hg help bundlespec)
361 :revs: the number of revisions in the repo at bundle creation time
361 :revs: the number of revisions in the repo at bundle creation time
362 :tip_rev: the rev-num of the tip revision
362 :tip_rev: the rev-num of the tip revision
363 :tip_node: the node id of the tip-most revision in the bundle
363 :tip_node: the node id of the tip-most revision in the bundle
364
364
365 :ready: True if the bundle is ready to be served
365 :ready: True if the bundle is ready to be served
366 """
366 """
367
367
368 ready = False
368 ready = False
369
369
370 def __init__(self, bundle_type, revs, tip_rev, tip_node):
370 def __init__(self, bundle_type, revs, tip_rev, tip_node):
371 self.bundle_type = bundle_type
371 self.bundle_type = bundle_type
372 self.revs = revs
372 self.revs = revs
373 self.tip_rev = tip_rev
373 self.tip_rev = tip_rev
374 self.tip_node = tip_node
374 self.tip_node = tip_node
375
375
376 def valid_for(self, repo):
376 def valid_for(self, repo):
377 """is this bundle applicable to the current repository
377 """is this bundle applicable to the current repository
378
378
379 This is useful for detecting bundles made irrelevant by stripping.
379 This is useful for detecting bundles made irrelevant by stripping.
380 """
380 """
381 tip_node = node.bin(self.tip_node)
381 tip_node = node.bin(self.tip_node)
382 return repo.changelog.index.get_rev(tip_node) == self.tip_rev
382 return repo.changelog.index.get_rev(tip_node) == self.tip_rev
383
383
384 def __eq__(self, other):
384 def __eq__(self, other):
385 left = (self.ready, self.bundle_type, self.tip_rev, self.tip_node)
385 left = (self.ready, self.bundle_type, self.tip_rev, self.tip_node)
386 right = (other.ready, other.bundle_type, other.tip_rev, other.tip_node)
386 right = (other.ready, other.bundle_type, other.tip_rev, other.tip_node)
387 return left == right
387 return left == right
388
388
389 def __neq__(self, other):
389 def __neq__(self, other):
390 return not self == other
390 return not self == other
391
391
392 def __cmp__(self, other):
392 def __cmp__(self, other):
393 if self == other:
393 if self == other:
394 return 0
394 return 0
395 return -1
395 return -1
396
396
397
397
398 class RequestedBundle(BundleBase):
398 class RequestedBundle(BundleBase):
399 """A bundle that should be generated.
399 """A bundle that should be generated.
400
400
401 Additional attributes compared to BundleBase
401 Additional attributes compared to BundleBase
402 :heads: list of head revisions (as rev-num)
402 :heads: list of head revisions (as rev-num)
403 :op_id: a "unique" identifier for the operation triggering the change
403 :op_id: a "unique" identifier for the operation triggering the change
404 """
404 """
405
405
406 def __init__(self, bundle_type, revs, tip_rev, tip_node, head_revs, op_id):
406 def __init__(self, bundle_type, revs, tip_rev, tip_node, head_revs, op_id):
407 self.head_revs = head_revs
407 self.head_revs = head_revs
408 self.op_id = op_id
408 self.op_id = op_id
409 super(RequestedBundle, self).__init__(
409 super(RequestedBundle, self).__init__(
410 bundle_type,
410 bundle_type,
411 revs,
411 revs,
412 tip_rev,
412 tip_rev,
413 tip_node,
413 tip_node,
414 )
414 )
415
415
416 @property
416 @property
417 def suggested_filename(self):
417 def suggested_filename(self):
418 """A filename that can be used for the generated bundle"""
418 """A filename that can be used for the generated bundle"""
419 data = {
419 data = {
420 b'bundle_type': self.bundle_type,
420 b'bundle_type': self.bundle_type,
421 b'revs': self.revs,
421 b'revs': self.revs,
422 b'heads': self.head_revs,
422 b'heads': self.head_revs,
423 b'tip_rev': self.tip_rev,
423 b'tip_rev': self.tip_rev,
424 b'tip_node': self.tip_node,
424 b'tip_node': self.tip_node,
425 b'tip_short': self.tip_node[:12],
425 b'tip_short': self.tip_node[:12],
426 b'op_id': self.op_id,
426 b'op_id': self.op_id,
427 }
427 }
428 return BUNDLE_MASK % data
428 return BUNDLE_MASK % data
429
429
430 def generate_bundle(self, repo, file_path):
430 def generate_bundle(self, repo, file_path):
431 """generate the bundle at `filepath`"""
431 """generate the bundle at `filepath`"""
432 commands.bundle(
432 commands.bundle(
433 repo.ui,
433 repo.ui,
434 repo,
434 repo,
435 file_path,
435 file_path,
436 base=[b"null"],
436 base=[b"null"],
437 rev=self.head_revs,
437 rev=self.head_revs,
438 type=self.bundle_type,
438 type=self.bundle_type,
439 quiet=True,
439 quiet=True,
440 )
440 )
441
441
442 def generating(self, file_path, hostname=None, pid=None):
442 def generating(self, file_path, hostname=None, pid=None):
443 """return a GeneratingBundle object from this object"""
443 """return a GeneratingBundle object from this object"""
444 if pid is None:
444 if pid is None:
445 pid = os.getpid()
445 pid = os.getpid()
446 if hostname is None:
446 if hostname is None:
447 hostname = lock._getlockprefix()
447 hostname = lock._getlockprefix()
448 return GeneratingBundle(
448 return GeneratingBundle(
449 self.bundle_type,
449 self.bundle_type,
450 self.revs,
450 self.revs,
451 self.tip_rev,
451 self.tip_rev,
452 self.tip_node,
452 self.tip_node,
453 hostname,
453 hostname,
454 pid,
454 pid,
455 file_path,
455 file_path,
456 )
456 )
457
457
458
458
459 class GeneratingBundle(BundleBase):
459 class GeneratingBundle(BundleBase):
460 """A bundle being generated
460 """A bundle being generated
461
461
462 extra attributes compared to BundleBase:
462 extra attributes compared to BundleBase:
463
463
464 :hostname: the hostname of the machine generating the bundle
464 :hostname: the hostname of the machine generating the bundle
465 :pid: the pid of the process generating the bundle
465 :pid: the pid of the process generating the bundle
466 :filepath: the target filename of the bundle
466 :filepath: the target filename of the bundle
467
467
468 These attributes exist to help detect stalled generation processes.
468 These attributes exist to help detect stalled generation processes.
469 """
469 """
470
470
471 ready = False
471 ready = False
472
472
473 def __init__(
473 def __init__(
474 self, bundle_type, revs, tip_rev, tip_node, hostname, pid, filepath
474 self, bundle_type, revs, tip_rev, tip_node, hostname, pid, filepath
475 ):
475 ):
476 self.hostname = hostname
476 self.hostname = hostname
477 self.pid = pid
477 self.pid = pid
478 self.filepath = filepath
478 self.filepath = filepath
479 super(GeneratingBundle, self).__init__(
479 super(GeneratingBundle, self).__init__(
480 bundle_type, revs, tip_rev, tip_node
480 bundle_type, revs, tip_rev, tip_node
481 )
481 )
482
482
483 @classmethod
483 @classmethod
484 def from_line(cls, line):
484 def from_line(cls, line):
485 """create an object by deserializing a line from AUTO_GEN_FILE"""
485 """create an object by deserializing a line from AUTO_GEN_FILE"""
486 assert line.startswith(b'PENDING-v1 ')
486 assert line.startswith(b'PENDING-v1 ')
487 (
487 (
488 __,
488 __,
489 bundle_type,
489 bundle_type,
490 revs,
490 revs,
491 tip_rev,
491 tip_rev,
492 tip_node,
492 tip_node,
493 hostname,
493 hostname,
494 pid,
494 pid,
495 filepath,
495 filepath,
496 ) = line.split()
496 ) = line.split()
497 hostname = util.urlreq.unquote(hostname)
497 hostname = util.urlreq.unquote(hostname)
498 filepath = util.urlreq.unquote(filepath)
498 filepath = util.urlreq.unquote(filepath)
499 revs = int(revs)
499 revs = int(revs)
500 tip_rev = int(tip_rev)
500 tip_rev = int(tip_rev)
501 pid = int(pid)
501 pid = int(pid)
502 return cls(
502 return cls(
503 bundle_type, revs, tip_rev, tip_node, hostname, pid, filepath
503 bundle_type, revs, tip_rev, tip_node, hostname, pid, filepath
504 )
504 )
505
505
506 def to_line(self):
506 def to_line(self):
507 """serialize the object to include as a line in AUTO_GEN_FILE"""
507 """serialize the object to include as a line in AUTO_GEN_FILE"""
508 templ = b"PENDING-v1 %s %d %d %s %s %d %s"
508 templ = b"PENDING-v1 %s %d %d %s %s %d %s"
509 data = (
509 data = (
510 self.bundle_type,
510 self.bundle_type,
511 self.revs,
511 self.revs,
512 self.tip_rev,
512 self.tip_rev,
513 self.tip_node,
513 self.tip_node,
514 util.urlreq.quote(self.hostname),
514 util.urlreq.quote(self.hostname),
515 self.pid,
515 self.pid,
516 util.urlreq.quote(self.filepath),
516 util.urlreq.quote(self.filepath),
517 )
517 )
518 return templ % data
518 return templ % data
519
519
520 def __eq__(self, other):
520 def __eq__(self, other):
521 if not super(GeneratingBundle, self).__eq__(other):
521 if not super(GeneratingBundle, self).__eq__(other):
522 return False
522 return False
523 left = (self.hostname, self.pid, self.filepath)
523 left = (self.hostname, self.pid, self.filepath)
524 right = (other.hostname, other.pid, other.filepath)
524 right = (other.hostname, other.pid, other.filepath)
525 return left == right
525 return left == right
526
526
527 def uploaded(self, url, basename):
527 def uploaded(self, url, basename):
528 """return a GeneratedBundle from this object"""
528 """return a GeneratedBundle from this object"""
529 return GeneratedBundle(
529 return GeneratedBundle(
530 self.bundle_type,
530 self.bundle_type,
531 self.revs,
531 self.revs,
532 self.tip_rev,
532 self.tip_rev,
533 self.tip_node,
533 self.tip_node,
534 url,
534 url,
535 basename,
535 basename,
536 )
536 )
537
537
538
538
539 class GeneratedBundle(BundleBase):
539 class GeneratedBundle(BundleBase):
540 """A bundle that is done being generated and can be served
540 """A bundle that is done being generated and can be served
541
541
542 extra attributes compared to BundleBase:
542 extra attributes compared to BundleBase:
543
543
544 :file_url: the url where the bundle is available.
544 :file_url: the url where the bundle is available.
545 :basename: the "basename" used to upload (useful for deletion)
545 :basename: the "basename" used to upload (useful for deletion)
546
546
547 These attributes exist to generate a bundle manifest
547 These attributes exist to generate a bundle manifest
548 (.hg/pullbundles.manifest)
548 (.hg/pullbundles.manifest)
549 """
549 """
550
550
551 ready = True
551 ready = True
552
552
553 def __init__(
553 def __init__(
554 self, bundle_type, revs, tip_rev, tip_node, file_url, basename
554 self, bundle_type, revs, tip_rev, tip_node, file_url, basename
555 ):
555 ):
556 self.file_url = file_url
556 self.file_url = file_url
557 self.basename = basename
557 self.basename = basename
558 super(GeneratedBundle, self).__init__(
558 super(GeneratedBundle, self).__init__(
559 bundle_type, revs, tip_rev, tip_node
559 bundle_type, revs, tip_rev, tip_node
560 )
560 )
561
561
562 @classmethod
562 @classmethod
563 def from_line(cls, line):
563 def from_line(cls, line):
564 """create an object by deserializing a line from AUTO_GEN_FILE"""
564 """create an object by deserializing a line from AUTO_GEN_FILE"""
565 assert line.startswith(b'DONE-v1 ')
565 assert line.startswith(b'DONE-v1 ')
566 (
566 (
567 __,
567 __,
568 bundle_type,
568 bundle_type,
569 revs,
569 revs,
570 tip_rev,
570 tip_rev,
571 tip_node,
571 tip_node,
572 file_url,
572 file_url,
573 basename,
573 basename,
574 ) = line.split()
574 ) = line.split()
575 revs = int(revs)
575 revs = int(revs)
576 tip_rev = int(tip_rev)
576 tip_rev = int(tip_rev)
577 file_url = util.urlreq.unquote(file_url)
577 file_url = util.urlreq.unquote(file_url)
578 return cls(bundle_type, revs, tip_rev, tip_node, file_url, basename)
578 return cls(bundle_type, revs, tip_rev, tip_node, file_url, basename)
579
579
580 def to_line(self):
580 def to_line(self):
581 """serialize the object to include as a line in AUTO_GEN_FILE"""
581 """serialize the object to include as a line in AUTO_GEN_FILE"""
582 templ = b"DONE-v1 %s %d %d %s %s %s"
582 templ = b"DONE-v1 %s %d %d %s %s %s"
583 data = (
583 data = (
584 self.bundle_type,
584 self.bundle_type,
585 self.revs,
585 self.revs,
586 self.tip_rev,
586 self.tip_rev,
587 self.tip_node,
587 self.tip_node,
588 util.urlreq.quote(self.file_url),
588 util.urlreq.quote(self.file_url),
589 self.basename,
589 self.basename,
590 )
590 )
591 return templ % data
591 return templ % data
592
592
593 def manifest_line(self):
593 def manifest_line(self):
594 """serialize the object to include as a line in pullbundles.manifest"""
594 """serialize the object to include as a line in pullbundles.manifest"""
595 templ = b"%s BUNDLESPEC=%s REQUIRESNI=true"
595 templ = b"%s BUNDLESPEC=%s REQUIRESNI=true"
596 return templ % (self.file_url, self.bundle_type)
596 return templ % (self.file_url, self.bundle_type)
597
597
598 def __eq__(self, other):
598 def __eq__(self, other):
599 if not super(GeneratedBundle, self).__eq__(other):
599 if not super(GeneratedBundle, self).__eq__(other):
600 return False
600 return False
601 return self.file_url == other.file_url
601 return self.file_url == other.file_url
602
602
603
603
604 def parse_auto_gen(content):
604 def parse_auto_gen(content):
605 """parse the AUTO_GEN_FILE to return a list of Bundle object"""
605 """parse the AUTO_GEN_FILE to return a list of Bundle object"""
606 bundles = []
606 bundles = []
607 for line in content.splitlines():
607 for line in content.splitlines():
608 if line.startswith(b'PENDING-v1 '):
608 if line.startswith(b'PENDING-v1 '):
609 bundles.append(GeneratingBundle.from_line(line))
609 bundles.append(GeneratingBundle.from_line(line))
610 elif line.startswith(b'DONE-v1 '):
610 elif line.startswith(b'DONE-v1 '):
611 bundles.append(GeneratedBundle.from_line(line))
611 bundles.append(GeneratedBundle.from_line(line))
612 return bundles
612 return bundles
613
613
614
614
615 def dumps_auto_gen(bundles):
615 def dumps_auto_gen(bundles):
616 """serialize a list of Bundle as a AUTO_GEN_FILE content"""
616 """serialize a list of Bundle as a AUTO_GEN_FILE content"""
617 lines = []
617 lines = []
618 for b in bundles:
618 for b in bundles:
619 lines.append(b"%s\n" % b.to_line())
619 lines.append(b"%s\n" % b.to_line())
620 lines.sort()
620 lines.sort()
621 return b"".join(lines)
621 return b"".join(lines)
622
622
623
623
624 def read_auto_gen(repo):
624 def read_auto_gen(repo):
625 """read the AUTO_GEN_FILE for the <repo> a list of Bundle object"""
625 """read the AUTO_GEN_FILE for the <repo> a list of Bundle object"""
626 data = repo.vfs.tryread(AUTO_GEN_FILE)
626 data = repo.vfs.tryread(AUTO_GEN_FILE)
627 if not data:
627 if not data:
628 return []
628 return []
629 return parse_auto_gen(data)
629 return parse_auto_gen(data)
630
630
631
631
632 def write_auto_gen(repo, bundles):
632 def write_auto_gen(repo, bundles):
633 """write a list of Bundle objects into the repo's AUTO_GEN_FILE"""
633 """write a list of Bundle objects into the repo's AUTO_GEN_FILE"""
634 assert repo._cb_lock_ref is not None
634 assert repo._cb_lock_ref is not None
635 data = dumps_auto_gen(bundles)
635 data = dumps_auto_gen(bundles)
636 with repo.vfs(AUTO_GEN_FILE, mode=b'wb', atomictemp=True) as f:
636 with repo.vfs(AUTO_GEN_FILE, mode=b'wb', atomictemp=True) as f:
637 f.write(data)
637 f.write(data)
638
638
639
639
640 def generate_manifest(bundles):
640 def generate_manifest(bundles):
641 """write a list of Bundle objects into the repo's AUTO_GEN_FILE"""
641 """write a list of Bundle objects into the repo's AUTO_GEN_FILE"""
642 bundles = list(bundles)
642 bundles = list(bundles)
643 bundles.sort(key=lambda b: b.bundle_type)
643 bundles.sort(key=lambda b: b.bundle_type)
644 lines = []
644 lines = []
645 for b in bundles:
645 for b in bundles:
646 lines.append(b"%s\n" % b.manifest_line())
646 lines.append(b"%s\n" % b.manifest_line())
647 return b"".join(lines)
647 return b"".join(lines)
648
648
649
649
650 def update_ondisk_manifest(repo):
650 def update_ondisk_manifest(repo):
651 """update the clonebundle manifest with latest url"""
651 """update the clonebundle manifest with latest url"""
652 with repo.clonebundles_lock():
652 with repo.clonebundles_lock():
653 bundles = read_auto_gen(repo)
653 bundles = read_auto_gen(repo)
654
654
655 per_types = {}
655 per_types = {}
656 for b in bundles:
656 for b in bundles:
657 if not (b.ready and b.valid_for(repo)):
657 if not (b.ready and b.valid_for(repo)):
658 continue
658 continue
659 current = per_types.get(b.bundle_type)
659 current = per_types.get(b.bundle_type)
660 if current is not None and current.revs >= b.revs:
660 if current is not None and current.revs >= b.revs:
661 continue
661 continue
662 per_types[b.bundle_type] = b
662 per_types[b.bundle_type] = b
663 manifest = generate_manifest(per_types.values())
663 manifest = generate_manifest(per_types.values())
664 with repo.vfs(
664 with repo.vfs(
665 bundlecaches.CB_MANIFEST_FILE, mode=b"wb", atomictemp=True
665 bundlecaches.CB_MANIFEST_FILE, mode=b"wb", atomictemp=True
666 ) as f:
666 ) as f:
667 f.write(manifest)
667 f.write(manifest)
668
668
669
669
670 def update_bundle_list(repo, new_bundles=(), del_bundles=()):
670 def update_bundle_list(repo, new_bundles=(), del_bundles=()):
671 """modify the repo's AUTO_GEN_FILE
671 """modify the repo's AUTO_GEN_FILE
672
672
673 This method also regenerates the clone bundle manifest when needed"""
673 This method also regenerates the clone bundle manifest when needed"""
674 with repo.clonebundles_lock():
674 with repo.clonebundles_lock():
675 bundles = read_auto_gen(repo)
675 bundles = read_auto_gen(repo)
676 if del_bundles:
676 if del_bundles:
677 bundles = [b for b in bundles if b not in del_bundles]
677 bundles = [b for b in bundles if b not in del_bundles]
678 new_bundles = [b for b in new_bundles if b not in bundles]
678 new_bundles = [b for b in new_bundles if b not in bundles]
679 bundles.extend(new_bundles)
679 bundles.extend(new_bundles)
680 write_auto_gen(repo, bundles)
680 write_auto_gen(repo, bundles)
681 all_changed = []
681 all_changed = []
682 all_changed.extend(new_bundles)
682 all_changed.extend(new_bundles)
683 all_changed.extend(del_bundles)
683 all_changed.extend(del_bundles)
684 if any(b.ready for b in all_changed):
684 if any(b.ready for b in all_changed):
685 update_ondisk_manifest(repo)
685 update_ondisk_manifest(repo)
686
686
687
687
688 def cleanup_tmp_bundle(repo, target):
688 def cleanup_tmp_bundle(repo, target):
689 """remove a GeneratingBundle file and entry"""
689 """remove a GeneratingBundle file and entry"""
690 assert not target.ready
690 assert not target.ready
691 with repo.clonebundles_lock():
691 with repo.clonebundles_lock():
692 repo.vfs.tryunlink(target.filepath)
692 repo.vfs.tryunlink(target.filepath)
693 update_bundle_list(repo, del_bundles=[target])
693 update_bundle_list(repo, del_bundles=[target])
694
694
695
695
696 def finalize_one_bundle(repo, target):
696 def finalize_one_bundle(repo, target):
697 """upload a generated bundle and advertise it in the clonebundles.manifest"""
697 """upload a generated bundle and advertise it in the clonebundles.manifest"""
698 with repo.clonebundles_lock():
698 with repo.clonebundles_lock():
699 bundles = read_auto_gen(repo)
699 bundles = read_auto_gen(repo)
700 if target in bundles and target.valid_for(repo):
700 if target in bundles and target.valid_for(repo):
701 result = upload_bundle(repo, target)
701 result = upload_bundle(repo, target)
702 update_bundle_list(repo, new_bundles=[result])
702 update_bundle_list(repo, new_bundles=[result])
703 cleanup_tmp_bundle(repo, target)
703 cleanup_tmp_bundle(repo, target)
704
704
705
705
706 def find_outdated_bundles(repo, bundles):
706 def find_outdated_bundles(repo, bundles):
707 """finds outdated bundles"""
707 """finds outdated bundles"""
708 olds = []
708 olds = []
709 per_types = {}
709 per_types = {}
710 for b in bundles:
710 for b in bundles:
711 if not b.valid_for(repo):
711 if not b.valid_for(repo):
712 olds.append(b)
712 olds.append(b)
713 continue
713 continue
714 l = per_types.setdefault(b.bundle_type, [])
714 l = per_types.setdefault(b.bundle_type, [])
715 l.append(b)
715 l.append(b)
716 for key in sorted(per_types):
716 for key in sorted(per_types):
717 all = per_types[key]
717 all = per_types[key]
718 if len(all) > 1:
718 if len(all) > 1:
719 all.sort(key=lambda b: b.revs, reverse=True)
719 all.sort(key=lambda b: b.revs, reverse=True)
720 olds.extend(all[1:])
720 olds.extend(all[1:])
721 return olds
721 return olds
722
722
723
723
724 def collect_garbage(repo):
724 def collect_garbage(repo):
725 """finds outdated bundles and get them deleted"""
725 """finds outdated bundles and get them deleted"""
726 with repo.clonebundles_lock():
726 with repo.clonebundles_lock():
727 bundles = read_auto_gen(repo)
727 bundles = read_auto_gen(repo)
728 olds = find_outdated_bundles(repo, bundles)
728 olds = find_outdated_bundles(repo, bundles)
729 for o in olds:
729 for o in olds:
730 delete_bundle(repo, o)
730 delete_bundle(repo, o)
731 update_bundle_list(repo, del_bundles=olds)
731 update_bundle_list(repo, del_bundles=olds)
732
732
733
733
734 def upload_bundle(repo, bundle):
734 def upload_bundle(repo, bundle):
735 """upload the result of a GeneratingBundle and return a GeneratedBundle
735 """upload the result of a GeneratingBundle and return a GeneratedBundle
736
736
737 The upload is done using the `clone-bundles.upload-command`
737 The upload is done using the `clone-bundles.upload-command`
738 """
738 """
739 cmd = repo.ui.config(b'clone-bundles', b'upload-command')
739 cmd = repo.ui.config(b'clone-bundles', b'upload-command')
740 url = repo.ui.config(b'clone-bundles', b'url-template')
740 url = repo.ui.config(b'clone-bundles', b'url-template')
741 basename = repo.vfs.basename(bundle.filepath)
741 basename = repo.vfs.basename(bundle.filepath)
742 filepath = procutil.shellquote(bundle.filepath)
742 filepath = procutil.shellquote(bundle.filepath)
743 variables = {
743 variables = {
744 b'HGCB_BUNDLE_PATH': filepath,
744 b'HGCB_BUNDLE_PATH': filepath,
745 b'HGCB_BUNDLE_BASENAME': basename,
745 b'HGCB_BUNDLE_BASENAME': basename,
746 }
746 }
747 env = procutil.shellenviron(environ=variables)
747 env = procutil.shellenviron(environ=variables)
748 ret = repo.ui.system(cmd, environ=env)
748 ret = repo.ui.system(cmd, environ=env)
749 if ret:
749 if ret:
750 raise error.Abort(b"command returned status %d: %s" % (ret, cmd))
750 raise error.Abort(b"command returned status %d: %s" % (ret, cmd))
751 url = (
751 url = (
752 url.decode('utf8')
752 url.decode('utf8')
753 .format(basename=basename.decode('utf8'))
753 .format(basename=basename.decode('utf8'))
754 .encode('utf8')
754 .encode('utf8')
755 )
755 )
756 return bundle.uploaded(url, basename)
756 return bundle.uploaded(url, basename)
757
757
758
758
759 def delete_bundle(repo, bundle):
759 def delete_bundle(repo, bundle):
760 """delete a bundle from storage"""
760 """delete a bundle from storage"""
761 assert bundle.ready
761 assert bundle.ready
762 msg = b'clone-bundles: deleting bundle %s\n'
762 msg = b'clone-bundles: deleting bundle %s\n'
763 msg %= bundle.basename
763 msg %= bundle.basename
764 if repo.ui.configbool(b'devel', b'debug.clonebundles'):
764 if repo.ui.configbool(b'devel', b'debug.clonebundles'):
765 repo.ui.write(msg)
765 repo.ui.write(msg)
766 else:
766 else:
767 repo.ui.debug(msg)
767 repo.ui.debug(msg)
768
768
769 cmd = repo.ui.config(b'clone-bundles', b'delete-command')
769 cmd = repo.ui.config(b'clone-bundles', b'delete-command')
770 variables = {
770 variables = {
771 b'HGCB_BUNDLE_URL': bundle.file_url,
771 b'HGCB_BUNDLE_URL': bundle.file_url,
772 b'HGCB_BASENAME': bundle.basename,
772 b'HGCB_BASENAME': bundle.basename,
773 }
773 }
774 env = procutil.shellenviron(environ=variables)
774 env = procutil.shellenviron(environ=variables)
775 ret = repo.ui.system(cmd, environ=env)
775 ret = repo.ui.system(cmd, environ=env)
776 if ret:
776 if ret:
777 raise error.Abort(b"command returned status %d: %s" % (ret, cmd))
777 raise error.Abort(b"command returned status %d: %s" % (ret, cmd))
778
778
779
779
780 def auto_bundle_needed_actions(repo, bundles, op_id):
780 def auto_bundle_needed_actions(repo, bundles, op_id):
781 """find the list of bundles that need action
781 """find the list of bundles that need action
782
782
783 returns a list of RequestedBundle objects that need to be generated and
783 returns a list of RequestedBundle objects that need to be generated and
784 uploaded."""
784 uploaded."""
785 create_bundles = []
785 create_bundles = []
786 delete_bundles = []
786 delete_bundles = []
787 repo = repo.filtered(b"immutable")
787 repo = repo.filtered(b"immutable")
788 targets = repo.ui.configlist(b'clone-bundles', b'auto-generate.formats')
788 targets = repo.ui.configlist(b'clone-bundles', b'auto-generate.formats')
789 ratio = float(
789 ratio = float(
790 repo.ui.config(b'clone-bundles', b'trigger.below-bundled-ratio')
790 repo.ui.config(b'clone-bundles', b'trigger.below-bundled-ratio')
791 )
791 )
792 abs_revs = repo.ui.configint(b'clone-bundles', b'trigger.revs')
792 abs_revs = repo.ui.configint(b'clone-bundles', b'trigger.revs')
793 revs = len(repo.changelog)
793 revs = len(repo.changelog)
794 generic_data = {
794 generic_data = {
795 'revs': revs,
795 'revs': revs,
796 'head_revs': repo.changelog.headrevs(),
796 'head_revs': repo.changelog.headrevs(),
797 'tip_rev': repo.changelog.tiprev(),
797 'tip_rev': repo.changelog.tiprev(),
798 'tip_node': node.hex(repo.changelog.tip()),
798 'tip_node': node.hex(repo.changelog.tip()),
799 'op_id': op_id,
799 'op_id': op_id,
800 }
800 }
801 for t in targets:
801 for t in targets:
802 if new_bundle_needed(repo, bundles, ratio, abs_revs, t, revs):
802 if new_bundle_needed(repo, bundles, ratio, abs_revs, t, revs):
803 data = generic_data.copy()
803 data = generic_data.copy()
804 data['bundle_type'] = t
804 data['bundle_type'] = t
805 b = RequestedBundle(**data)
805 b = RequestedBundle(**data)
806 create_bundles.append(b)
806 create_bundles.append(b)
807 delete_bundles.extend(find_outdated_bundles(repo, bundles))
807 delete_bundles.extend(find_outdated_bundles(repo, bundles))
808 return create_bundles, delete_bundles
808 return create_bundles, delete_bundles
809
809
810
810
811 def new_bundle_needed(repo, bundles, ratio, abs_revs, bundle_type, revs):
811 def new_bundle_needed(repo, bundles, ratio, abs_revs, bundle_type, revs):
812 """consider the current cached content and trigger new bundles if needed"""
812 """consider the current cached content and trigger new bundles if needed"""
813 threshold = max((revs * ratio), (revs - abs_revs))
813 threshold = max((revs * ratio), (revs - abs_revs))
814 for b in bundles:
814 for b in bundles:
815 if not b.valid_for(repo) or b.bundle_type != bundle_type:
815 if not b.valid_for(repo) or b.bundle_type != bundle_type:
816 continue
816 continue
817 if b.revs > threshold:
817 if b.revs > threshold:
818 return False
818 return False
819 return True
819 return True
820
820
821
821
822 def start_one_bundle(repo, bundle):
822 def start_one_bundle(repo, bundle):
823 """start the generation of a single bundle file
823 """start the generation of a single bundle file
824
824
825 the `bundle` argument should be a RequestedBundle object.
825 the `bundle` argument should be a RequestedBundle object.
826
826
827 This data is passed to the `debugmakeclonebundles` "as is".
827 This data is passed to the `debugmakeclonebundles` "as is".
828 """
828 """
829 data = util.pickle.dumps(bundle)
829 data = util.pickle.dumps(bundle)
830 cmd = [procutil.hgexecutable(), b'--cwd', repo.path, INTERNAL_CMD]
830 cmd = [procutil.hgexecutable(), b'--cwd', repo.path, INTERNAL_CMD]
831 env = procutil.shellenviron()
831 env = procutil.shellenviron()
832 msg = b'clone-bundles: starting bundle generation: %s\n'
832 msg = b'clone-bundles: starting bundle generation: %s\n'
833 stdout = None
833 stdout = None
834 stderr = None
834 stderr = None
835 waits = []
835 waits = []
836 record_wait = None
836 record_wait = None
837 if repo.ui.configbool(b'devel', b'debug.clonebundles'):
837 if repo.ui.configbool(b'devel', b'debug.clonebundles'):
838 stdout = procutil.stdout
838 stdout = procutil.stdout
839 stderr = procutil.stderr
839 stderr = procutil.stderr
840 repo.ui.write(msg % bundle.bundle_type)
840 repo.ui.write(msg % bundle.bundle_type)
841 record_wait = waits.append
841 record_wait = waits.append
842 else:
842 else:
843 repo.ui.debug(msg % bundle.bundle_type)
843 repo.ui.debug(msg % bundle.bundle_type)
844 bg = procutil.runbgcommand
844 bg = procutil.runbgcommand
845 bg(
845 bg(
846 cmd,
846 cmd,
847 env,
847 env,
848 stdin_bytes=data,
848 stdin_bytes=data,
849 stdout=stdout,
849 stdout=stdout,
850 stderr=stderr,
850 stderr=stderr,
851 record_wait=record_wait,
851 record_wait=record_wait,
852 )
852 )
853 for f in waits:
853 for f in waits:
854 f()
854 f()
855
855
856
856
857 INTERNAL_CMD = b'debug::internal-make-clone-bundles'
857 INTERNAL_CMD = b'debug::internal-make-clone-bundles'
858
858
859
859
860 @command(INTERNAL_CMD, [], b'')
860 @command(INTERNAL_CMD, [], b'')
861 def debugmakeclonebundles(ui, repo):
861 def debugmakeclonebundles(ui, repo):
862 """Internal command to auto-generate debug bundles"""
862 """Internal command to auto-generate debug bundles"""
863 requested_bundle = util.pickle.load(procutil.stdin)
863 requested_bundle = util.pickle.load(procutil.stdin)
864 procutil.stdin.close()
864 procutil.stdin.close()
865
865
866 collect_garbage(repo)
866 collect_garbage(repo)
867
867
868 fname = requested_bundle.suggested_filename
868 fname = requested_bundle.suggested_filename
869 fpath = repo.vfs.makedirs(b'tmp-bundles')
869 fpath = repo.vfs.makedirs(b'tmp-bundles')
870 fpath = repo.vfs.join(b'tmp-bundles', fname)
870 fpath = repo.vfs.join(b'tmp-bundles', fname)
871 bundle = requested_bundle.generating(fpath)
871 bundle = requested_bundle.generating(fpath)
872 update_bundle_list(repo, new_bundles=[bundle])
872 update_bundle_list(repo, new_bundles=[bundle])
873
873
874 requested_bundle.generate_bundle(repo, fpath)
874 requested_bundle.generate_bundle(repo, fpath)
875
875
876 repo.invalidate()
876 repo.invalidate()
877 finalize_one_bundle(repo, bundle)
877 finalize_one_bundle(repo, bundle)
878
878
879
879
880 def make_auto_bundler(source_repo):
880 def make_auto_bundler(source_repo):
881 reporef = weakref.ref(source_repo)
881 reporef = weakref.ref(source_repo)
882
882
883 def autobundle(tr):
883 def autobundle(tr):
884 repo = reporef()
884 repo = reporef()
885 assert repo is not None
885 assert repo is not None
886 bundles = read_auto_gen(repo)
886 bundles = read_auto_gen(repo)
887 new, __ = auto_bundle_needed_actions(repo, bundles, b"%d_txn" % id(tr))
887 new, __ = auto_bundle_needed_actions(repo, bundles, b"%d_txn" % id(tr))
888 for data in new:
888 for data in new:
889 start_one_bundle(repo, data)
889 start_one_bundle(repo, data)
890 return None
890 return None
891
891
892 return autobundle
892 return autobundle
893
893
894
894
895 def reposetup(ui, repo):
895 def reposetup(ui, repo):
896 """install the two pieces needed for automatic clonebundle generation
896 """install the two pieces needed for automatic clonebundle generation
897
897
898 - add a "post-close" hook that fires bundling when needed
898 - add a "post-close" hook that fires bundling when needed
899 - introduce a clone-bundle lock to let multiple processes meddle with the
899 - introduce a clone-bundle lock to let multiple processes meddle with the
900 state files.
900 state files.
901 """
901 """
902 if not repo.local():
902 if not repo.local():
903 return
903 return
904
904
905 class autobundlesrepo(repo.__class__):
905 class autobundlesrepo(repo.__class__):
906 def transaction(self, *args, **kwargs):
906 def transaction(self, *args, **kwargs):
907 tr = super(autobundlesrepo, self).transaction(*args, **kwargs)
907 tr = super(autobundlesrepo, self).transaction(*args, **kwargs)
908 enabled = repo.ui.configbool(
908 enabled = repo.ui.configbool(
909 b'clone-bundles',
909 b'clone-bundles',
910 b'auto-generate.on-change',
910 b'auto-generate.on-change',
911 )
911 )
912 targets = repo.ui.configlist(
912 targets = repo.ui.configlist(
913 b'clone-bundles', b'auto-generate.formats'
913 b'clone-bundles', b'auto-generate.formats'
914 )
914 )
915 if enabled and targets:
915 if enabled and targets:
916 tr.addpostclose(CAT_POSTCLOSE, make_auto_bundler(self))
916 tr.addpostclose(CAT_POSTCLOSE, make_auto_bundler(self))
917 return tr
917 return tr
918
918
919 @localrepo.unfilteredmethod
919 @localrepo.unfilteredmethod
920 def clonebundles_lock(self, wait=True):
920 def clonebundles_lock(self, wait=True):
921 '''Lock the repository file related to clone bundles'''
921 '''Lock the repository file related to clone bundles'''
922 if not util.safehasattr(self, '_cb_lock_ref'):
922 if not util.safehasattr(self, '_cb_lock_ref'):
923 self._cb_lock_ref = None
923 self._cb_lock_ref = None
924 l = self._currentlock(self._cb_lock_ref)
924 l = self._currentlock(self._cb_lock_ref)
925 if l is not None:
925 if l is not None:
926 l.lock()
926 l.lock()
927 return l
927 return l
928
928
929 l = self._lock(
929 l = self._lock(
930 vfs=self.vfs,
930 vfs=self.vfs,
931 lockname=b"clonebundleslock",
931 lockname=b"clonebundleslock",
932 wait=wait,
932 wait=wait,
933 releasefn=None,
933 releasefn=None,
934 acquirefn=None,
934 acquirefn=None,
935 desc=_(b'repository %s') % self.origroot,
935 desc=_(b'repository %s') % self.origroot,
936 )
936 )
937 self._cb_lock_ref = weakref.ref(l)
937 self._cb_lock_ref = weakref.ref(l)
938 return l
938 return l
939
939
940 repo._wlockfreeprefix.add(AUTO_GEN_FILE)
940 repo._wlockfreeprefix.add(AUTO_GEN_FILE)
941 repo._wlockfreeprefix.add(bundlecaches.CB_MANIFEST_FILE)
941 repo._wlockfreeprefix.add(bundlecaches.CB_MANIFEST_FILE)
942 repo.__class__ = autobundlesrepo
942 repo.__class__ = autobundlesrepo
943
943
944
944
945 @command(b'admin::clone-bundles-refresh', [], b'')
945 @command(b'admin::clone-bundles-refresh', [], b'')
946 def cmd_admin_clone_bundles_refresh(ui, repo: localrepo.localrepository):
946 def cmd_admin_clone_bundles_refresh(ui, repo: localrepo.localrepository):
947 """generate clone bundles according to the configuration
947 """generate clone bundles according to the configuration
948
948
949 This runs the logic for automatic generation, removing outdated bundles and
949 This runs the logic for automatic generation, removing outdated bundles and
950 generating new ones if necessary. See :hg:`help -e clone-bundles` for
950 generating new ones if necessary. See :hg:`help -e clone-bundles` for
951 details about how to configure this feature.
951 details about how to configure this feature.
952 """
952 """
953 debug = repo.ui.configbool(b'devel', b'debug.clonebundles')
953 debug = repo.ui.configbool(b'devel', b'debug.clonebundles')
954 bundles = read_auto_gen(repo)
954 bundles = read_auto_gen(repo)
955 op_id = b"%d_acbr" % os.getpid()
955 op_id = b"%d_acbr" % os.getpid()
956 create, delete = auto_bundle_needed_actions(repo, bundles, op_id)
956 create, delete = auto_bundle_needed_actions(repo, bundles, op_id)
957
957
958 # we clean up outdated bundle before generating new one to keep the last
958 # we clean up outdated bundle before generating new one to keep the last
959 # two version of the bundle around for a while and avoid having to deal
959 # two version of the bundle around for a while and avoid having to deal
960 # client that just got served a manifest.
960 # client that just got served a manifest.
961 for o in delete:
961 for o in delete:
962 delete_bundle(repo, o)
962 delete_bundle(repo, o)
963 update_bundle_list(repo, del_bundles=delete)
963 update_bundle_list(repo, del_bundles=delete)
964
964
965 if create:
965 if create:
966 fpath = repo.vfs.makedirs(b'tmp-bundles')
966 fpath = repo.vfs.makedirs(b'tmp-bundles')
967 for requested_bundle in create:
967 for requested_bundle in create:
968 if debug:
968 if debug:
969 msg = b'clone-bundles: starting bundle generation: %s\n'
969 msg = b'clone-bundles: starting bundle generation: %s\n'
970 repo.ui.write(msg % requested_bundle.bundle_type)
970 repo.ui.write(msg % requested_bundle.bundle_type)
971 fname = requested_bundle.suggested_filename
971 fname = requested_bundle.suggested_filename
972 fpath = repo.vfs.join(b'tmp-bundles', fname)
972 fpath = repo.vfs.join(b'tmp-bundles', fname)
973 generating_bundle = requested_bundle.generating(fpath)
973 generating_bundle = requested_bundle.generating(fpath)
974 update_bundle_list(repo, new_bundles=[generating_bundle])
974 update_bundle_list(repo, new_bundles=[generating_bundle])
975 requested_bundle.generate_bundle(repo, fpath)
975 requested_bundle.generate_bundle(repo, fpath)
976 result = upload_bundle(repo, generating_bundle)
976 result = upload_bundle(repo, generating_bundle)
977 update_bundle_list(repo, new_bundles=[result])
977 update_bundle_list(repo, new_bundles=[result])
978 update_ondisk_manifest(repo)
978 update_ondisk_manifest(repo)
979 cleanup_tmp_bundle(repo, generating_bundle)
979 cleanup_tmp_bundle(repo, generating_bundle)
980
981
982 @command(b'admin::clone-bundles-clear', [], b'')
983 def cmd_admin_clone_bundles_clear(ui, repo: localrepo.localrepository):
984 """remove existing clone bundle caches
985
986 See `hg help admin::clone-bundles-refresh` for details on how to regenerate
987 them.
988
989 This command will only affect bundles currently available, it will not
990 affect bundles being asynchronously generated.
991 """
992 bundles = read_auto_gen(repo)
993 delete = [b for b in bundles if b.ready]
994 for o in delete:
995 delete_bundle(repo, o)
996 update_bundle_list(repo, del_bundles=delete)
@@ -1,320 +1,337 b''
1
1
2 #require no-reposimplestore no-chg
2 #require no-reposimplestore no-chg
3
3
4 initial setup
4 initial setup
5
5
6 $ hg init server
6 $ hg init server
7 $ cat >> server/.hg/hgrc << EOF
7 $ cat >> server/.hg/hgrc << EOF
8 > [extensions]
8 > [extensions]
9 > clonebundles =
9 > clonebundles =
10 >
10 >
11 > [clone-bundles]
11 > [clone-bundles]
12 > auto-generate.on-change = yes
12 > auto-generate.on-change = yes
13 > auto-generate.formats = v2
13 > auto-generate.formats = v2
14 > upload-command = cp "\$HGCB_BUNDLE_PATH" "$TESTTMP"/final-upload/
14 > upload-command = cp "\$HGCB_BUNDLE_PATH" "$TESTTMP"/final-upload/
15 > delete-command = rm -f "$TESTTMP/final-upload/\$HGCB_BASENAME"
15 > delete-command = rm -f "$TESTTMP/final-upload/\$HGCB_BASENAME"
16 > url-template = file://$TESTTMP/final-upload/{basename}
16 > url-template = file://$TESTTMP/final-upload/{basename}
17 >
17 >
18 > [devel]
18 > [devel]
19 > debug.clonebundles=yes
19 > debug.clonebundles=yes
20 > EOF
20 > EOF
21
21
22 $ mkdir final-upload
22 $ mkdir final-upload
23 $ hg clone server client
23 $ hg clone server client
24 updating to branch default
24 updating to branch default
25 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 $ cd client
26 $ cd client
27
27
28 Test bundles are generated on push
28 Test bundles are generated on push
29 ==================================
29 ==================================
30
30
31 $ touch foo
31 $ touch foo
32 $ hg -q commit -A -m 'add foo'
32 $ hg -q commit -A -m 'add foo'
33 $ touch bar
33 $ touch bar
34 $ hg -q commit -A -m 'add bar'
34 $ hg -q commit -A -m 'add bar'
35 $ hg push
35 $ hg push
36 pushing to $TESTTMP/server
36 pushing to $TESTTMP/server
37 searching for changes
37 searching for changes
38 adding changesets
38 adding changesets
39 adding manifests
39 adding manifests
40 adding file changes
40 adding file changes
41 2 changesets found
41 2 changesets found
42 added 2 changesets with 2 changes to 2 files
42 added 2 changesets with 2 changes to 2 files
43 clone-bundles: starting bundle generation: v2
43 clone-bundles: starting bundle generation: v2
44 $ cat ../server/.hg/clonebundles.manifest
44 $ cat ../server/.hg/clonebundles.manifest
45 file:/*/$TESTTMP/final-upload/full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
45 file:/*/$TESTTMP/final-upload/full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
46 $ ls -1 ../final-upload
46 $ ls -1 ../final-upload
47 full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob)
47 full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob)
48 $ ls -1 ../server/.hg/tmp-bundles
48 $ ls -1 ../server/.hg/tmp-bundles
49
49
50 Newer bundles are generated with more pushes
50 Newer bundles are generated with more pushes
51 --------------------------------------------
51 --------------------------------------------
52
52
53 $ touch baz
53 $ touch baz
54 $ hg -q commit -A -m 'add baz'
54 $ hg -q commit -A -m 'add baz'
55 $ touch buz
55 $ touch buz
56 $ hg -q commit -A -m 'add buz'
56 $ hg -q commit -A -m 'add buz'
57 $ hg push
57 $ hg push
58 pushing to $TESTTMP/server
58 pushing to $TESTTMP/server
59 searching for changes
59 searching for changes
60 adding changesets
60 adding changesets
61 adding manifests
61 adding manifests
62 adding file changes
62 adding file changes
63 4 changesets found
63 4 changesets found
64 added 2 changesets with 2 changes to 2 files
64 added 2 changesets with 2 changes to 2 files
65 clone-bundles: starting bundle generation: v2
65 clone-bundles: starting bundle generation: v2
66
66
67 $ cat ../server/.hg/clonebundles.manifest
67 $ cat ../server/.hg/clonebundles.manifest
68 file:/*/$TESTTMP/final-upload/full-v2-4_revs-6427147b985a_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
68 file:/*/$TESTTMP/final-upload/full-v2-4_revs-6427147b985a_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
69 $ ls -1 ../final-upload
69 $ ls -1 ../final-upload
70 full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob)
70 full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob)
71 full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob)
71 full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob)
72 $ ls -1 ../server/.hg/tmp-bundles
72 $ ls -1 ../server/.hg/tmp-bundles
73
73
74 Older bundles are cleaned up with more pushes
74 Older bundles are cleaned up with more pushes
75 ---------------------------------------------
75 ---------------------------------------------
76
76
77 $ touch faz
77 $ touch faz
78 $ hg -q commit -A -m 'add faz'
78 $ hg -q commit -A -m 'add faz'
79 $ touch fuz
79 $ touch fuz
80 $ hg -q commit -A -m 'add fuz'
80 $ hg -q commit -A -m 'add fuz'
81 $ hg push
81 $ hg push
82 pushing to $TESTTMP/server
82 pushing to $TESTTMP/server
83 searching for changes
83 searching for changes
84 adding changesets
84 adding changesets
85 adding manifests
85 adding manifests
86 adding file changes
86 adding file changes
87 clone-bundles: deleting bundle full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob)
87 clone-bundles: deleting bundle full-v2-2_revs-aaff8d2ffbbf_tip-*_txn.hg (glob)
88 6 changesets found
88 6 changesets found
89 added 2 changesets with 2 changes to 2 files
89 added 2 changesets with 2 changes to 2 files
90 clone-bundles: starting bundle generation: v2
90 clone-bundles: starting bundle generation: v2
91
91
92 $ cat ../server/.hg/clonebundles.manifest
92 $ cat ../server/.hg/clonebundles.manifest
93 file:/*/$TESTTMP/final-upload/full-v2-6_revs-b1010e95ea00_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
93 file:/*/$TESTTMP/final-upload/full-v2-6_revs-b1010e95ea00_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
94 $ ls -1 ../final-upload
94 $ ls -1 ../final-upload
95 full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob)
95 full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob)
96 full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob)
96 full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob)
97 $ ls -1 ../server/.hg/tmp-bundles
97 $ ls -1 ../server/.hg/tmp-bundles
98
98
99 Test conditions to get them generated
99 Test conditions to get them generated
100 =====================================
100 =====================================
101
101
102 Check ratio
102 Check ratio
103
103
104 $ cat >> ../server/.hg/hgrc << EOF
104 $ cat >> ../server/.hg/hgrc << EOF
105 > [clone-bundles]
105 > [clone-bundles]
106 > trigger.below-bundled-ratio = 0.5
106 > trigger.below-bundled-ratio = 0.5
107 > EOF
107 > EOF
108 $ touch far
108 $ touch far
109 $ hg -q commit -A -m 'add far'
109 $ hg -q commit -A -m 'add far'
110 $ hg push
110 $ hg push
111 pushing to $TESTTMP/server
111 pushing to $TESTTMP/server
112 searching for changes
112 searching for changes
113 adding changesets
113 adding changesets
114 adding manifests
114 adding manifests
115 adding file changes
115 adding file changes
116 added 1 changesets with 1 changes to 1 files
116 added 1 changesets with 1 changes to 1 files
117 $ cat ../server/.hg/clonebundles.manifest
117 $ cat ../server/.hg/clonebundles.manifest
118 file:/*/$TESTTMP/final-upload/full-v2-6_revs-b1010e95ea00_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
118 file:/*/$TESTTMP/final-upload/full-v2-6_revs-b1010e95ea00_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
119 $ ls -1 ../final-upload
119 $ ls -1 ../final-upload
120 full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob)
120 full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob)
121 full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob)
121 full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob)
122 $ ls -1 ../server/.hg/tmp-bundles
122 $ ls -1 ../server/.hg/tmp-bundles
123
123
124 Check absolute number of revisions
124 Check absolute number of revisions
125
125
126 $ cat >> ../server/.hg/hgrc << EOF
126 $ cat >> ../server/.hg/hgrc << EOF
127 > [clone-bundles]
127 > [clone-bundles]
128 > trigger.revs = 2
128 > trigger.revs = 2
129 > EOF
129 > EOF
130 $ touch bur
130 $ touch bur
131 $ hg -q commit -A -m 'add bur'
131 $ hg -q commit -A -m 'add bur'
132 $ hg push
132 $ hg push
133 pushing to $TESTTMP/server
133 pushing to $TESTTMP/server
134 searching for changes
134 searching for changes
135 adding changesets
135 adding changesets
136 adding manifests
136 adding manifests
137 adding file changes
137 adding file changes
138 clone-bundles: deleting bundle full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob)
138 clone-bundles: deleting bundle full-v2-4_revs-6427147b985a_tip-*_txn.hg (glob)
139 8 changesets found
139 8 changesets found
140 added 1 changesets with 1 changes to 1 files
140 added 1 changesets with 1 changes to 1 files
141 clone-bundles: starting bundle generation: v2
141 clone-bundles: starting bundle generation: v2
142 $ cat ../server/.hg/clonebundles.manifest
142 $ cat ../server/.hg/clonebundles.manifest
143 file:/*/$TESTTMP/final-upload/full-v2-8_revs-8353e8af1306_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
143 file:/*/$TESTTMP/final-upload/full-v2-8_revs-8353e8af1306_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
144 $ ls -1 ../final-upload
144 $ ls -1 ../final-upload
145 full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob)
145 full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob)
146 full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob)
146 full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob)
147 $ ls -1 ../server/.hg/tmp-bundles
147 $ ls -1 ../server/.hg/tmp-bundles
148
148
149 (that one would not generate new bundles)
149 (that one would not generate new bundles)
150
150
151 $ touch tur
151 $ touch tur
152 $ hg -q commit -A -m 'add tur'
152 $ hg -q commit -A -m 'add tur'
153 $ hg push
153 $ hg push
154 pushing to $TESTTMP/server
154 pushing to $TESTTMP/server
155 searching for changes
155 searching for changes
156 adding changesets
156 adding changesets
157 adding manifests
157 adding manifests
158 adding file changes
158 adding file changes
159 added 1 changesets with 1 changes to 1 files
159 added 1 changesets with 1 changes to 1 files
160 $ cat ../server/.hg/clonebundles.manifest
160 $ cat ../server/.hg/clonebundles.manifest
161 file:/*/$TESTTMP/final-upload/full-v2-8_revs-8353e8af1306_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
161 file:/*/$TESTTMP/final-upload/full-v2-8_revs-8353e8af1306_tip-*_txn.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
162 $ ls -1 ../final-upload
162 $ ls -1 ../final-upload
163 full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob)
163 full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob)
164 full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob)
164 full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob)
165 $ ls -1 ../server/.hg/tmp-bundles
165 $ ls -1 ../server/.hg/tmp-bundles
166
166
167 Test generation through the dedicated command
167 Test generation through the dedicated command
168 =============================================
168 =============================================
169
169
170 $ cat >> ../server/.hg/hgrc << EOF
170 $ cat >> ../server/.hg/hgrc << EOF
171 > [clone-bundles]
171 > [clone-bundles]
172 > auto-generate.on-change = no
172 > auto-generate.on-change = no
173 > EOF
173 > EOF
174
174
175 Check the command can generate content when needed
175 Check the command can generate content when needed
176 --------------------------------------------------
176 --------------------------------------------------
177
177
178 Do a push that makes the condition fulfilled,
178 Do a push that makes the condition fulfilled,
179 Yet it should not automatically generate a bundle with
179 Yet it should not automatically generate a bundle with
180 "auto-generate.on-change" not set.
180 "auto-generate.on-change" not set.
181
181
182 $ touch quoi
182 $ touch quoi
183 $ hg -q commit -A -m 'add quoi'
183 $ hg -q commit -A -m 'add quoi'
184
184
185 $ pre_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat`
185 $ pre_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat`
186 $ pre_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat`
186 $ pre_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat`
187 $ ls -1 ../server/.hg/tmp-bundles
187 $ ls -1 ../server/.hg/tmp-bundles
188
188
189 $ hg push
189 $ hg push
190 pushing to $TESTTMP/server
190 pushing to $TESTTMP/server
191 searching for changes
191 searching for changes
192 adding changesets
192 adding changesets
193 adding manifests
193 adding manifests
194 adding file changes
194 adding file changes
195 added 1 changesets with 1 changes to 1 files
195 added 1 changesets with 1 changes to 1 files
196
196
197 $ post_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat`
197 $ post_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat`
198 $ post_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat`
198 $ post_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat`
199 $ ls -1 ../server/.hg/tmp-bundles
199 $ ls -1 ../server/.hg/tmp-bundles
200 $ test "$pre_push_manifest" = "$post_push_manifest"
200 $ test "$pre_push_manifest" = "$post_push_manifest"
201 $ test "$pre_push_upload" = "$post_push_upload"
201 $ test "$pre_push_upload" = "$post_push_upload"
202
202
203 Running the command should detect the stale bundles, and do the full automatic
203 Running the command should detect the stale bundles, and do the full automatic
204 generation logic.
204 generation logic.
205
205
206 $ hg -R ../server/ admin::clone-bundles-refresh
206 $ hg -R ../server/ admin::clone-bundles-refresh
207 clone-bundles: deleting bundle full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob)
207 clone-bundles: deleting bundle full-v2-6_revs-b1010e95ea00_tip-*_txn.hg (glob)
208 clone-bundles: starting bundle generation: v2
208 clone-bundles: starting bundle generation: v2
209 10 changesets found
209 10 changesets found
210 $ cat ../server/.hg/clonebundles.manifest
210 $ cat ../server/.hg/clonebundles.manifest
211 file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
211 file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
212 $ ls -1 ../final-upload
212 $ ls -1 ../final-upload
213 full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob)
213 full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob)
214 full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob)
214 full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob)
215 $ ls -1 ../server/.hg/tmp-bundles
215 $ ls -1 ../server/.hg/tmp-bundles
216
216
217 Check the command cleans up older bundles when possible
217 Check the command cleans up older bundles when possible
218 -------------------------------------------------------
218 -------------------------------------------------------
219
219
220 $ hg -R ../server/ admin::clone-bundles-refresh
220 $ hg -R ../server/ admin::clone-bundles-refresh
221 clone-bundles: deleting bundle full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob)
221 clone-bundles: deleting bundle full-v2-8_revs-8353e8af1306_tip-*_txn.hg (glob)
222 $ cat ../server/.hg/clonebundles.manifest
222 $ cat ../server/.hg/clonebundles.manifest
223 file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
223 file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
224 $ ls -1 ../final-upload
224 $ ls -1 ../final-upload
225 full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob)
225 full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob)
226 $ ls -1 ../server/.hg/tmp-bundles
226 $ ls -1 ../server/.hg/tmp-bundles
227
227
228 Nothing is generated when the bundles are sufficiently up to date
228 Nothing is generated when the bundles are sufficiently up to date
229 -----------------------------------------------------------------
229 -----------------------------------------------------------------
230
230
231 $ touch feur
231 $ touch feur
232 $ hg -q commit -A -m 'add feur'
232 $ hg -q commit -A -m 'add feur'
233
233
234 $ pre_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat`
234 $ pre_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat`
235 $ pre_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat`
235 $ pre_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat`
236 $ ls -1 ../server/.hg/tmp-bundles
236 $ ls -1 ../server/.hg/tmp-bundles
237
237
238 $ hg push
238 $ hg push
239 pushing to $TESTTMP/server
239 pushing to $TESTTMP/server
240 searching for changes
240 searching for changes
241 adding changesets
241 adding changesets
242 adding manifests
242 adding manifests
243 adding file changes
243 adding file changes
244 added 1 changesets with 1 changes to 1 files
244 added 1 changesets with 1 changes to 1 files
245
245
246 $ post_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat`
246 $ post_push_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat`
247 $ post_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat`
247 $ post_push_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat`
248 $ ls -1 ../server/.hg/tmp-bundles
248 $ ls -1 ../server/.hg/tmp-bundles
249 $ test "$pre_push_manifest" = "$post_push_manifest"
249 $ test "$pre_push_manifest" = "$post_push_manifest"
250 $ test "$pre_push_upload" = "$post_push_upload"
250 $ test "$pre_push_upload" = "$post_push_upload"
251
251
252 $ hg -R ../server/ admin::clone-bundles-refresh
252 $ hg -R ../server/ admin::clone-bundles-refresh
253
253
254 $ post_refresh_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat`
254 $ post_refresh_manifest=`cat ../server/.hg/clonebundles.manifest|f --sha256 | sed 's/.*=//' | cat`
255 $ post_refresh_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat`
255 $ post_refresh_upload=`ls -1 ../final-upload|f --sha256 | sed 's/.*=//' | cat`
256 $ ls -1 ../server/.hg/tmp-bundles
256 $ ls -1 ../server/.hg/tmp-bundles
257 $ test "$pre_push_manifest" = "$post_refresh_manifest"
257 $ test "$pre_push_manifest" = "$post_refresh_manifest"
258 $ test "$pre_push_upload" = "$post_refresh_upload"
258 $ test "$pre_push_upload" = "$post_refresh_upload"
259
259
260 Test modification of configuration
260 Test modification of configuration
261 ==================================
261 ==================================
262
262
263 Testing that later runs adapt to configuration changes even if the repository is
263 Testing that later runs adapt to configuration changes even if the repository is
264 unchanged.
264 unchanged.
265
265
266 adding more formats
266 adding more formats
267 -------------------
267 -------------------
268
268
269 bundle for added formats should be generated
269 bundle for added formats should be generated
270
270
271 change configuration
271 change configuration
272
272
273 $ cat >> ../server/.hg/hgrc << EOF
273 $ cat >> ../server/.hg/hgrc << EOF
274 > [clone-bundles]
274 > [clone-bundles]
275 > auto-generate.formats = v1, v2
275 > auto-generate.formats = v1, v2
276 > EOF
276 > EOF
277
277
278 refresh the bundles
278 refresh the bundles
279
279
280 $ hg -R ../server/ admin::clone-bundles-refresh
280 $ hg -R ../server/ admin::clone-bundles-refresh
281 clone-bundles: starting bundle generation: v1
281 clone-bundles: starting bundle generation: v1
282 11 changesets found
282 11 changesets found
283
283
284 the bundle for the "new" format should have been added
284 the bundle for the "new" format should have been added
285
285
286 $ cat ../server/.hg/clonebundles.manifest
286 $ cat ../server/.hg/clonebundles.manifest
287 file:/*/$TESTTMP/final-upload/full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=v1 REQUIRESNI=true (glob)
287 file:/*/$TESTTMP/final-upload/full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=v1 REQUIRESNI=true (glob)
288 file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
288 file:/*/$TESTTMP/final-upload/full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
289 $ ls -1 ../final-upload
289 $ ls -1 ../final-upload
290 full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
290 full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
291 full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob)
291 full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob)
292 $ ls -1 ../server/.hg/tmp-bundles
292 $ ls -1 ../server/.hg/tmp-bundles
293
293
294 Changing the ratio
294 Changing the ratio
295 ------------------
295 ------------------
296
296
297 Changing the ratio to something that would have triggered a bundle during the last push.
297 Changing the ratio to something that would have triggered a bundle during the last push.
298
298
299 $ cat >> ../server/.hg/hgrc << EOF
299 $ cat >> ../server/.hg/hgrc << EOF
300 > [clone-bundles]
300 > [clone-bundles]
301 > trigger.below-bundled-ratio = 0.95
301 > trigger.below-bundled-ratio = 0.95
302 > EOF
302 > EOF
303
303
304 refresh the bundles
304 refresh the bundles
305
305
306 $ hg -R ../server/ admin::clone-bundles-refresh
306 $ hg -R ../server/ admin::clone-bundles-refresh
307 clone-bundles: starting bundle generation: v2
307 clone-bundles: starting bundle generation: v2
308 11 changesets found
308 11 changesets found
309
309
310
310
311 the "outdated' bundle should be refreshed
311 the "outdated' bundle should be refreshed
312
312
313 $ cat ../server/.hg/clonebundles.manifest
313 $ cat ../server/.hg/clonebundles.manifest
314 file:/*/$TESTTMP/final-upload/full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=v1 REQUIRESNI=true (glob)
314 file:/*/$TESTTMP/final-upload/full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=v1 REQUIRESNI=true (glob)
315 file:/*/$TESTTMP/final-upload/full-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
315 file:/*/$TESTTMP/final-upload/full-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg BUNDLESPEC=v2 REQUIRESNI=true (glob)
316 $ ls -1 ../final-upload
316 $ ls -1 ../final-upload
317 full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
317 full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
318 full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob)
318 full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob)
319 full-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
319 full-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
320 $ ls -1 ../server/.hg/tmp-bundles
320 $ ls -1 ../server/.hg/tmp-bundles
321
322 Test more command options
323 =========================
324
325 bundle clearing
326 ---------------
327
328 $ hg -R ../server/ admin::clone-bundles-clear
329 clone-bundles: deleting bundle full-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
330 clone-bundles: deleting bundle full-v2-10_revs-3b6f57f17d70_tip-*_acbr.hg (glob)
331 clone-bundles: deleting bundle full-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
332
333 Nothing should remain
334
335 $ cat ../server/.hg/clonebundles.manifest
336 $ ls -1 ../final-upload
337 $ ls -1 ../server/.hg/tmp-bundles
@@ -1,4081 +1,4082 b''
1 Short help:
1 Short help:
2
2
3 $ hg
3 $ hg
4 Mercurial Distributed SCM
4 Mercurial Distributed SCM
5
5
6 basic commands:
6 basic commands:
7
7
8 add add the specified files on the next commit
8 add add the specified files on the next commit
9 annotate show changeset information by line for each file
9 annotate show changeset information by line for each file
10 clone make a copy of an existing repository
10 clone make a copy of an existing repository
11 commit commit the specified files or all outstanding changes
11 commit commit the specified files or all outstanding changes
12 diff diff repository (or selected files)
12 diff diff repository (or selected files)
13 export dump the header and diffs for one or more changesets
13 export dump the header and diffs for one or more changesets
14 forget forget the specified files on the next commit
14 forget forget the specified files on the next commit
15 init create a new repository in the given directory
15 init create a new repository in the given directory
16 log show revision history of entire repository or files
16 log show revision history of entire repository or files
17 merge merge another revision into working directory
17 merge merge another revision into working directory
18 pull pull changes from the specified source
18 pull pull changes from the specified source
19 push push changes to the specified destination
19 push push changes to the specified destination
20 remove remove the specified files on the next commit
20 remove remove the specified files on the next commit
21 serve start stand-alone webserver
21 serve start stand-alone webserver
22 status show changed files in the working directory
22 status show changed files in the working directory
23 summary summarize working directory state
23 summary summarize working directory state
24 update update working directory (or switch revisions)
24 update update working directory (or switch revisions)
25
25
26 (use 'hg help' for the full list of commands or 'hg -v' for details)
26 (use 'hg help' for the full list of commands or 'hg -v' for details)
27
27
28 $ hg -q
28 $ hg -q
29 add add the specified files on the next commit
29 add add the specified files on the next commit
30 annotate show changeset information by line for each file
30 annotate show changeset information by line for each file
31 clone make a copy of an existing repository
31 clone make a copy of an existing repository
32 commit commit the specified files or all outstanding changes
32 commit commit the specified files or all outstanding changes
33 diff diff repository (or selected files)
33 diff diff repository (or selected files)
34 export dump the header and diffs for one or more changesets
34 export dump the header and diffs for one or more changesets
35 forget forget the specified files on the next commit
35 forget forget the specified files on the next commit
36 init create a new repository in the given directory
36 init create a new repository in the given directory
37 log show revision history of entire repository or files
37 log show revision history of entire repository or files
38 merge merge another revision into working directory
38 merge merge another revision into working directory
39 pull pull changes from the specified source
39 pull pull changes from the specified source
40 push push changes to the specified destination
40 push push changes to the specified destination
41 remove remove the specified files on the next commit
41 remove remove the specified files on the next commit
42 serve start stand-alone webserver
42 serve start stand-alone webserver
43 status show changed files in the working directory
43 status show changed files in the working directory
44 summary summarize working directory state
44 summary summarize working directory state
45 update update working directory (or switch revisions)
45 update update working directory (or switch revisions)
46
46
47 Extra extensions will be printed in help output in a non-reliable order since
47 Extra extensions will be printed in help output in a non-reliable order since
48 the extension is unknown.
48 the extension is unknown.
49 #if no-extraextensions
49 #if no-extraextensions
50
50
51 $ hg help
51 $ hg help
52 Mercurial Distributed SCM
52 Mercurial Distributed SCM
53
53
54 list of commands:
54 list of commands:
55
55
56 Repository creation:
56 Repository creation:
57
57
58 clone make a copy of an existing repository
58 clone make a copy of an existing repository
59 init create a new repository in the given directory
59 init create a new repository in the given directory
60
60
61 Remote repository management:
61 Remote repository management:
62
62
63 incoming show new changesets found in source
63 incoming show new changesets found in source
64 outgoing show changesets not found in the destination
64 outgoing show changesets not found in the destination
65 paths show aliases for remote repositories
65 paths show aliases for remote repositories
66 pull pull changes from the specified source
66 pull pull changes from the specified source
67 push push changes to the specified destination
67 push push changes to the specified destination
68 serve start stand-alone webserver
68 serve start stand-alone webserver
69
69
70 Change creation:
70 Change creation:
71
71
72 commit commit the specified files or all outstanding changes
72 commit commit the specified files or all outstanding changes
73
73
74 Change manipulation:
74 Change manipulation:
75
75
76 backout reverse effect of earlier changeset
76 backout reverse effect of earlier changeset
77 graft copy changes from other branches onto the current branch
77 graft copy changes from other branches onto the current branch
78 merge merge another revision into working directory
78 merge merge another revision into working directory
79
79
80 Change organization:
80 Change organization:
81
81
82 bookmarks create a new bookmark or list existing bookmarks
82 bookmarks create a new bookmark or list existing bookmarks
83 branch set or show the current branch name
83 branch set or show the current branch name
84 branches list repository named branches
84 branches list repository named branches
85 phase set or show the current phase name
85 phase set or show the current phase name
86 tag add one or more tags for the current or given revision
86 tag add one or more tags for the current or given revision
87 tags list repository tags
87 tags list repository tags
88
88
89 File content management:
89 File content management:
90
90
91 annotate show changeset information by line for each file
91 annotate show changeset information by line for each file
92 cat output the current or given revision of files
92 cat output the current or given revision of files
93 copy mark files as copied for the next commit
93 copy mark files as copied for the next commit
94 diff diff repository (or selected files)
94 diff diff repository (or selected files)
95 grep search for a pattern in specified files
95 grep search for a pattern in specified files
96
96
97 Change navigation:
97 Change navigation:
98
98
99 bisect subdivision search of changesets
99 bisect subdivision search of changesets
100 heads show branch heads
100 heads show branch heads
101 identify identify the working directory or specified revision
101 identify identify the working directory or specified revision
102 log show revision history of entire repository or files
102 log show revision history of entire repository or files
103
103
104 Working directory management:
104 Working directory management:
105
105
106 add add the specified files on the next commit
106 add add the specified files on the next commit
107 addremove add all new files, delete all missing files
107 addremove add all new files, delete all missing files
108 files list tracked files
108 files list tracked files
109 forget forget the specified files on the next commit
109 forget forget the specified files on the next commit
110 purge removes files not tracked by Mercurial
110 purge removes files not tracked by Mercurial
111 remove remove the specified files on the next commit
111 remove remove the specified files on the next commit
112 rename rename files; equivalent of copy + remove
112 rename rename files; equivalent of copy + remove
113 resolve redo merges or set/view the merge status of files
113 resolve redo merges or set/view the merge status of files
114 revert restore files to their checkout state
114 revert restore files to their checkout state
115 root print the root (top) of the current working directory
115 root print the root (top) of the current working directory
116 shelve save and set aside changes from the working directory
116 shelve save and set aside changes from the working directory
117 status show changed files in the working directory
117 status show changed files in the working directory
118 summary summarize working directory state
118 summary summarize working directory state
119 unshelve restore a shelved change to the working directory
119 unshelve restore a shelved change to the working directory
120 update update working directory (or switch revisions)
120 update update working directory (or switch revisions)
121
121
122 Change import/export:
122 Change import/export:
123
123
124 archive create an unversioned archive of a repository revision
124 archive create an unversioned archive of a repository revision
125 bundle create a bundle file
125 bundle create a bundle file
126 export dump the header and diffs for one or more changesets
126 export dump the header and diffs for one or more changesets
127 import import an ordered set of patches
127 import import an ordered set of patches
128 unbundle apply one or more bundle files
128 unbundle apply one or more bundle files
129
129
130 Repository maintenance:
130 Repository maintenance:
131
131
132 manifest output the current or given revision of the project manifest
132 manifest output the current or given revision of the project manifest
133 recover roll back an interrupted transaction
133 recover roll back an interrupted transaction
134 verify verify the integrity of the repository
134 verify verify the integrity of the repository
135
135
136 Help:
136 Help:
137
137
138 config show combined config settings from all hgrc files
138 config show combined config settings from all hgrc files
139 help show help for a given topic or a help overview
139 help show help for a given topic or a help overview
140 version output version and copyright information
140 version output version and copyright information
141
141
142 additional help topics:
142 additional help topics:
143
143
144 Mercurial identifiers:
144 Mercurial identifiers:
145
145
146 filesets Specifying File Sets
146 filesets Specifying File Sets
147 hgignore Syntax for Mercurial Ignore Files
147 hgignore Syntax for Mercurial Ignore Files
148 patterns File Name Patterns
148 patterns File Name Patterns
149 revisions Specifying Revisions
149 revisions Specifying Revisions
150 urls URL Paths
150 urls URL Paths
151
151
152 Mercurial output:
152 Mercurial output:
153
153
154 color Colorizing Outputs
154 color Colorizing Outputs
155 dates Date Formats
155 dates Date Formats
156 diffs Diff Formats
156 diffs Diff Formats
157 templating Template Usage
157 templating Template Usage
158
158
159 Mercurial configuration:
159 Mercurial configuration:
160
160
161 config Configuration Files
161 config Configuration Files
162 environment Environment Variables
162 environment Environment Variables
163 extensions Using Additional Features
163 extensions Using Additional Features
164 flags Command-line flags
164 flags Command-line flags
165 hgweb Configuring hgweb
165 hgweb Configuring hgweb
166 merge-tools Merge Tools
166 merge-tools Merge Tools
167 pager Pager Support
167 pager Pager Support
168 rust Rust in Mercurial
168 rust Rust in Mercurial
169
169
170 Concepts:
170 Concepts:
171
171
172 bundlespec Bundle File Formats
172 bundlespec Bundle File Formats
173 evolution Safely rewriting history (EXPERIMENTAL)
173 evolution Safely rewriting history (EXPERIMENTAL)
174 glossary Glossary
174 glossary Glossary
175 phases Working with Phases
175 phases Working with Phases
176 subrepos Subrepositories
176 subrepos Subrepositories
177
177
178 Miscellaneous:
178 Miscellaneous:
179
179
180 deprecated Deprecated Features
180 deprecated Deprecated Features
181 internals Technical implementation topics
181 internals Technical implementation topics
182 scripting Using Mercurial from scripts and automation
182 scripting Using Mercurial from scripts and automation
183
183
184 (use 'hg help -v' to show built-in aliases and global options)
184 (use 'hg help -v' to show built-in aliases and global options)
185
185
186 $ hg -q help
186 $ hg -q help
187 Repository creation:
187 Repository creation:
188
188
189 clone make a copy of an existing repository
189 clone make a copy of an existing repository
190 init create a new repository in the given directory
190 init create a new repository in the given directory
191
191
192 Remote repository management:
192 Remote repository management:
193
193
194 incoming show new changesets found in source
194 incoming show new changesets found in source
195 outgoing show changesets not found in the destination
195 outgoing show changesets not found in the destination
196 paths show aliases for remote repositories
196 paths show aliases for remote repositories
197 pull pull changes from the specified source
197 pull pull changes from the specified source
198 push push changes to the specified destination
198 push push changes to the specified destination
199 serve start stand-alone webserver
199 serve start stand-alone webserver
200
200
201 Change creation:
201 Change creation:
202
202
203 commit commit the specified files or all outstanding changes
203 commit commit the specified files or all outstanding changes
204
204
205 Change manipulation:
205 Change manipulation:
206
206
207 backout reverse effect of earlier changeset
207 backout reverse effect of earlier changeset
208 graft copy changes from other branches onto the current branch
208 graft copy changes from other branches onto the current branch
209 merge merge another revision into working directory
209 merge merge another revision into working directory
210
210
211 Change organization:
211 Change organization:
212
212
213 bookmarks create a new bookmark or list existing bookmarks
213 bookmarks create a new bookmark or list existing bookmarks
214 branch set or show the current branch name
214 branch set or show the current branch name
215 branches list repository named branches
215 branches list repository named branches
216 phase set or show the current phase name
216 phase set or show the current phase name
217 tag add one or more tags for the current or given revision
217 tag add one or more tags for the current or given revision
218 tags list repository tags
218 tags list repository tags
219
219
220 File content management:
220 File content management:
221
221
222 annotate show changeset information by line for each file
222 annotate show changeset information by line for each file
223 cat output the current or given revision of files
223 cat output the current or given revision of files
224 copy mark files as copied for the next commit
224 copy mark files as copied for the next commit
225 diff diff repository (or selected files)
225 diff diff repository (or selected files)
226 grep search for a pattern in specified files
226 grep search for a pattern in specified files
227
227
228 Change navigation:
228 Change navigation:
229
229
230 bisect subdivision search of changesets
230 bisect subdivision search of changesets
231 heads show branch heads
231 heads show branch heads
232 identify identify the working directory or specified revision
232 identify identify the working directory or specified revision
233 log show revision history of entire repository or files
233 log show revision history of entire repository or files
234
234
235 Working directory management:
235 Working directory management:
236
236
237 add add the specified files on the next commit
237 add add the specified files on the next commit
238 addremove add all new files, delete all missing files
238 addremove add all new files, delete all missing files
239 files list tracked files
239 files list tracked files
240 forget forget the specified files on the next commit
240 forget forget the specified files on the next commit
241 purge removes files not tracked by Mercurial
241 purge removes files not tracked by Mercurial
242 remove remove the specified files on the next commit
242 remove remove the specified files on the next commit
243 rename rename files; equivalent of copy + remove
243 rename rename files; equivalent of copy + remove
244 resolve redo merges or set/view the merge status of files
244 resolve redo merges or set/view the merge status of files
245 revert restore files to their checkout state
245 revert restore files to their checkout state
246 root print the root (top) of the current working directory
246 root print the root (top) of the current working directory
247 shelve save and set aside changes from the working directory
247 shelve save and set aside changes from the working directory
248 status show changed files in the working directory
248 status show changed files in the working directory
249 summary summarize working directory state
249 summary summarize working directory state
250 unshelve restore a shelved change to the working directory
250 unshelve restore a shelved change to the working directory
251 update update working directory (or switch revisions)
251 update update working directory (or switch revisions)
252
252
253 Change import/export:
253 Change import/export:
254
254
255 archive create an unversioned archive of a repository revision
255 archive create an unversioned archive of a repository revision
256 bundle create a bundle file
256 bundle create a bundle file
257 export dump the header and diffs for one or more changesets
257 export dump the header and diffs for one or more changesets
258 import import an ordered set of patches
258 import import an ordered set of patches
259 unbundle apply one or more bundle files
259 unbundle apply one or more bundle files
260
260
261 Repository maintenance:
261 Repository maintenance:
262
262
263 manifest output the current or given revision of the project manifest
263 manifest output the current or given revision of the project manifest
264 recover roll back an interrupted transaction
264 recover roll back an interrupted transaction
265 verify verify the integrity of the repository
265 verify verify the integrity of the repository
266
266
267 Help:
267 Help:
268
268
269 config show combined config settings from all hgrc files
269 config show combined config settings from all hgrc files
270 help show help for a given topic or a help overview
270 help show help for a given topic or a help overview
271 version output version and copyright information
271 version output version and copyright information
272
272
273 additional help topics:
273 additional help topics:
274
274
275 Mercurial identifiers:
275 Mercurial identifiers:
276
276
277 filesets Specifying File Sets
277 filesets Specifying File Sets
278 hgignore Syntax for Mercurial Ignore Files
278 hgignore Syntax for Mercurial Ignore Files
279 patterns File Name Patterns
279 patterns File Name Patterns
280 revisions Specifying Revisions
280 revisions Specifying Revisions
281 urls URL Paths
281 urls URL Paths
282
282
283 Mercurial output:
283 Mercurial output:
284
284
285 color Colorizing Outputs
285 color Colorizing Outputs
286 dates Date Formats
286 dates Date Formats
287 diffs Diff Formats
287 diffs Diff Formats
288 templating Template Usage
288 templating Template Usage
289
289
290 Mercurial configuration:
290 Mercurial configuration:
291
291
292 config Configuration Files
292 config Configuration Files
293 environment Environment Variables
293 environment Environment Variables
294 extensions Using Additional Features
294 extensions Using Additional Features
295 flags Command-line flags
295 flags Command-line flags
296 hgweb Configuring hgweb
296 hgweb Configuring hgweb
297 merge-tools Merge Tools
297 merge-tools Merge Tools
298 pager Pager Support
298 pager Pager Support
299 rust Rust in Mercurial
299 rust Rust in Mercurial
300
300
301 Concepts:
301 Concepts:
302
302
303 bundlespec Bundle File Formats
303 bundlespec Bundle File Formats
304 evolution Safely rewriting history (EXPERIMENTAL)
304 evolution Safely rewriting history (EXPERIMENTAL)
305 glossary Glossary
305 glossary Glossary
306 phases Working with Phases
306 phases Working with Phases
307 subrepos Subrepositories
307 subrepos Subrepositories
308
308
309 Miscellaneous:
309 Miscellaneous:
310
310
311 deprecated Deprecated Features
311 deprecated Deprecated Features
312 internals Technical implementation topics
312 internals Technical implementation topics
313 scripting Using Mercurial from scripts and automation
313 scripting Using Mercurial from scripts and automation
314
314
315 Test extension help:
315 Test extension help:
316 $ hg help extensions --config extensions.rebase= --config extensions.children=
316 $ hg help extensions --config extensions.rebase= --config extensions.children=
317 Using Additional Features
317 Using Additional Features
318 """""""""""""""""""""""""
318 """""""""""""""""""""""""
319
319
320 Mercurial has the ability to add new features through the use of
320 Mercurial has the ability to add new features through the use of
321 extensions. Extensions may add new commands, add options to existing
321 extensions. Extensions may add new commands, add options to existing
322 commands, change the default behavior of commands, or implement hooks.
322 commands, change the default behavior of commands, or implement hooks.
323
323
324 To enable the "foo" extension, either shipped with Mercurial or in the
324 To enable the "foo" extension, either shipped with Mercurial or in the
325 Python search path, create an entry for it in your configuration file,
325 Python search path, create an entry for it in your configuration file,
326 like this:
326 like this:
327
327
328 [extensions]
328 [extensions]
329 foo =
329 foo =
330
330
331 You may also specify the full path to an extension:
331 You may also specify the full path to an extension:
332
332
333 [extensions]
333 [extensions]
334 myfeature = ~/.hgext/myfeature.py
334 myfeature = ~/.hgext/myfeature.py
335
335
336 See 'hg help config' for more information on configuration files.
336 See 'hg help config' for more information on configuration files.
337
337
338 Extensions are not loaded by default for a variety of reasons: they can
338 Extensions are not loaded by default for a variety of reasons: they can
339 increase startup overhead; they may be meant for advanced usage only; they
339 increase startup overhead; they may be meant for advanced usage only; they
340 may provide potentially dangerous abilities (such as letting you destroy
340 may provide potentially dangerous abilities (such as letting you destroy
341 or modify history); they might not be ready for prime time; or they may
341 or modify history); they might not be ready for prime time; or they may
342 alter some usual behaviors of stock Mercurial. It is thus up to the user
342 alter some usual behaviors of stock Mercurial. It is thus up to the user
343 to activate extensions as needed.
343 to activate extensions as needed.
344
344
345 To explicitly disable an extension enabled in a configuration file of
345 To explicitly disable an extension enabled in a configuration file of
346 broader scope, prepend its path with !:
346 broader scope, prepend its path with !:
347
347
348 [extensions]
348 [extensions]
349 # disabling extension bar residing in /path/to/extension/bar.py
349 # disabling extension bar residing in /path/to/extension/bar.py
350 bar = !/path/to/extension/bar.py
350 bar = !/path/to/extension/bar.py
351 # ditto, but no path was supplied for extension baz
351 # ditto, but no path was supplied for extension baz
352 baz = !
352 baz = !
353
353
354 enabled extensions:
354 enabled extensions:
355
355
356 children command to display child changesets (DEPRECATED)
356 children command to display child changesets (DEPRECATED)
357 rebase command to move sets of revisions to a different ancestor
357 rebase command to move sets of revisions to a different ancestor
358
358
359 disabled extensions:
359 disabled extensions:
360
360
361 acl hooks for controlling repository access
361 acl hooks for controlling repository access
362 blackbox log repository events to a blackbox for debugging
362 blackbox log repository events to a blackbox for debugging
363 bugzilla hooks for integrating with the Bugzilla bug tracker
363 bugzilla hooks for integrating with the Bugzilla bug tracker
364 censor erase file content at a given revision
364 censor erase file content at a given revision
365 churn command to display statistics about repository history
365 churn command to display statistics about repository history
366 clonebundles advertise pre-generated bundles to seed clones
366 clonebundles advertise pre-generated bundles to seed clones
367 closehead close arbitrary heads without checking them out first
367 closehead close arbitrary heads without checking them out first
368 convert import revisions from foreign VCS repositories into
368 convert import revisions from foreign VCS repositories into
369 Mercurial
369 Mercurial
370 eol automatically manage newlines in repository files
370 eol automatically manage newlines in repository files
371 extdiff command to allow external programs to compare revisions
371 extdiff command to allow external programs to compare revisions
372 factotum http authentication with factotum
372 factotum http authentication with factotum
373 fastexport export repositories as git fast-import stream
373 fastexport export repositories as git fast-import stream
374 githelp try mapping git commands to Mercurial commands
374 githelp try mapping git commands to Mercurial commands
375 gpg commands to sign and verify changesets
375 gpg commands to sign and verify changesets
376 hgk browse the repository in a graphical way
376 hgk browse the repository in a graphical way
377 highlight syntax highlighting for hgweb (requires Pygments)
377 highlight syntax highlighting for hgweb (requires Pygments)
378 histedit interactive history editing
378 histedit interactive history editing
379 keyword expand keywords in tracked files
379 keyword expand keywords in tracked files
380 largefiles track large binary files
380 largefiles track large binary files
381 mq manage a stack of patches
381 mq manage a stack of patches
382 notify hooks for sending email push notifications
382 notify hooks for sending email push notifications
383 patchbomb command to send changesets as (a series of) patch emails
383 patchbomb command to send changesets as (a series of) patch emails
384 relink recreates hardlinks between repository clones
384 relink recreates hardlinks between repository clones
385 schemes extend schemes with shortcuts to repository swarms
385 schemes extend schemes with shortcuts to repository swarms
386 share share a common history between several working directories
386 share share a common history between several working directories
387 transplant command to transplant changesets from another branch
387 transplant command to transplant changesets from another branch
388 win32mbcs allow the use of MBCS paths with problematic encodings
388 win32mbcs allow the use of MBCS paths with problematic encodings
389 zeroconf discover and advertise repositories on the local network
389 zeroconf discover and advertise repositories on the local network
390
390
391 #endif
391 #endif
392
392
393 Verify that deprecated extensions are included if --verbose:
393 Verify that deprecated extensions are included if --verbose:
394
394
395 $ hg -v help extensions | grep children
395 $ hg -v help extensions | grep children
396 children command to display child changesets (DEPRECATED)
396 children command to display child changesets (DEPRECATED)
397
397
398 Verify that extension keywords appear in help templates
398 Verify that extension keywords appear in help templates
399
399
400 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
400 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
401
401
402 Test short command list with verbose option
402 Test short command list with verbose option
403
403
404 $ hg -v help shortlist
404 $ hg -v help shortlist
405 Mercurial Distributed SCM
405 Mercurial Distributed SCM
406
406
407 basic commands:
407 basic commands:
408
408
409 abort abort an unfinished operation (EXPERIMENTAL)
409 abort abort an unfinished operation (EXPERIMENTAL)
410 add add the specified files on the next commit
410 add add the specified files on the next commit
411 annotate, blame
411 annotate, blame
412 show changeset information by line for each file
412 show changeset information by line for each file
413 clone make a copy of an existing repository
413 clone make a copy of an existing repository
414 commit, ci commit the specified files or all outstanding changes
414 commit, ci commit the specified files or all outstanding changes
415 continue resumes an interrupted operation (EXPERIMENTAL)
415 continue resumes an interrupted operation (EXPERIMENTAL)
416 diff diff repository (or selected files)
416 diff diff repository (or selected files)
417 export dump the header and diffs for one or more changesets
417 export dump the header and diffs for one or more changesets
418 forget forget the specified files on the next commit
418 forget forget the specified files on the next commit
419 init create a new repository in the given directory
419 init create a new repository in the given directory
420 log, history show revision history of entire repository or files
420 log, history show revision history of entire repository or files
421 merge merge another revision into working directory
421 merge merge another revision into working directory
422 pull pull changes from the specified source
422 pull pull changes from the specified source
423 push push changes to the specified destination
423 push push changes to the specified destination
424 remove, rm remove the specified files on the next commit
424 remove, rm remove the specified files on the next commit
425 serve start stand-alone webserver
425 serve start stand-alone webserver
426 status, st show changed files in the working directory
426 status, st show changed files in the working directory
427 summary, sum summarize working directory state
427 summary, sum summarize working directory state
428 update, up, checkout, co
428 update, up, checkout, co
429 update working directory (or switch revisions)
429 update working directory (or switch revisions)
430
430
431 global options ([+] can be repeated):
431 global options ([+] can be repeated):
432
432
433 -R --repository REPO repository root directory or name of overlay bundle
433 -R --repository REPO repository root directory or name of overlay bundle
434 file
434 file
435 --cwd DIR change working directory
435 --cwd DIR change working directory
436 -y --noninteractive do not prompt, automatically pick the first choice for
436 -y --noninteractive do not prompt, automatically pick the first choice for
437 all prompts
437 all prompts
438 -q --quiet suppress output
438 -q --quiet suppress output
439 -v --verbose enable additional output
439 -v --verbose enable additional output
440 --color TYPE when to colorize (boolean, always, auto, never, or
440 --color TYPE when to colorize (boolean, always, auto, never, or
441 debug)
441 debug)
442 --config CONFIG [+] set/override config option (use 'section.name=value')
442 --config CONFIG [+] set/override config option (use 'section.name=value')
443 --debug enable debugging output
443 --debug enable debugging output
444 --debugger start debugger
444 --debugger start debugger
445 --encoding ENCODE set the charset encoding (default: ascii)
445 --encoding ENCODE set the charset encoding (default: ascii)
446 --encodingmode MODE set the charset encoding mode (default: strict)
446 --encodingmode MODE set the charset encoding mode (default: strict)
447 --traceback always print a traceback on exception
447 --traceback always print a traceback on exception
448 --time time how long the command takes
448 --time time how long the command takes
449 --profile print command execution profile
449 --profile print command execution profile
450 --version output version information and exit
450 --version output version information and exit
451 -h --help display help and exit
451 -h --help display help and exit
452 --hidden consider hidden changesets
452 --hidden consider hidden changesets
453 --pager TYPE when to paginate (boolean, always, auto, or never)
453 --pager TYPE when to paginate (boolean, always, auto, or never)
454 (default: auto)
454 (default: auto)
455
455
456 (use 'hg help' for the full list of commands)
456 (use 'hg help' for the full list of commands)
457
457
458 $ hg add -h
458 $ hg add -h
459 hg add [OPTION]... [FILE]...
459 hg add [OPTION]... [FILE]...
460
460
461 add the specified files on the next commit
461 add the specified files on the next commit
462
462
463 Schedule files to be version controlled and added to the repository.
463 Schedule files to be version controlled and added to the repository.
464
464
465 The files will be added to the repository at the next commit. To undo an
465 The files will be added to the repository at the next commit. To undo an
466 add before that, see 'hg forget'.
466 add before that, see 'hg forget'.
467
467
468 If no names are given, add all files to the repository (except files
468 If no names are given, add all files to the repository (except files
469 matching ".hgignore").
469 matching ".hgignore").
470
470
471 Returns 0 if all files are successfully added.
471 Returns 0 if all files are successfully added.
472
472
473 options ([+] can be repeated):
473 options ([+] can be repeated):
474
474
475 -I --include PATTERN [+] include names matching the given patterns
475 -I --include PATTERN [+] include names matching the given patterns
476 -X --exclude PATTERN [+] exclude names matching the given patterns
476 -X --exclude PATTERN [+] exclude names matching the given patterns
477 -S --subrepos recurse into subrepositories
477 -S --subrepos recurse into subrepositories
478 -n --dry-run do not perform actions, just print output
478 -n --dry-run do not perform actions, just print output
479
479
480 (some details hidden, use --verbose to show complete help)
480 (some details hidden, use --verbose to show complete help)
481
481
482 Verbose help for add
482 Verbose help for add
483
483
484 $ hg add -hv
484 $ hg add -hv
485 hg add [OPTION]... [FILE]...
485 hg add [OPTION]... [FILE]...
486
486
487 add the specified files on the next commit
487 add the specified files on the next commit
488
488
489 Schedule files to be version controlled and added to the repository.
489 Schedule files to be version controlled and added to the repository.
490
490
491 The files will be added to the repository at the next commit. To undo an
491 The files will be added to the repository at the next commit. To undo an
492 add before that, see 'hg forget'.
492 add before that, see 'hg forget'.
493
493
494 If no names are given, add all files to the repository (except files
494 If no names are given, add all files to the repository (except files
495 matching ".hgignore").
495 matching ".hgignore").
496
496
497 Examples:
497 Examples:
498
498
499 - New (unknown) files are added automatically by 'hg add':
499 - New (unknown) files are added automatically by 'hg add':
500
500
501 $ ls
501 $ ls
502 foo.c
502 foo.c
503 $ hg status
503 $ hg status
504 ? foo.c
504 ? foo.c
505 $ hg add
505 $ hg add
506 adding foo.c
506 adding foo.c
507 $ hg status
507 $ hg status
508 A foo.c
508 A foo.c
509
509
510 - Specific files to be added can be specified:
510 - Specific files to be added can be specified:
511
511
512 $ ls
512 $ ls
513 bar.c foo.c
513 bar.c foo.c
514 $ hg status
514 $ hg status
515 ? bar.c
515 ? bar.c
516 ? foo.c
516 ? foo.c
517 $ hg add bar.c
517 $ hg add bar.c
518 $ hg status
518 $ hg status
519 A bar.c
519 A bar.c
520 ? foo.c
520 ? foo.c
521
521
522 Returns 0 if all files are successfully added.
522 Returns 0 if all files are successfully added.
523
523
524 options ([+] can be repeated):
524 options ([+] can be repeated):
525
525
526 -I --include PATTERN [+] include names matching the given patterns
526 -I --include PATTERN [+] include names matching the given patterns
527 -X --exclude PATTERN [+] exclude names matching the given patterns
527 -X --exclude PATTERN [+] exclude names matching the given patterns
528 -S --subrepos recurse into subrepositories
528 -S --subrepos recurse into subrepositories
529 -n --dry-run do not perform actions, just print output
529 -n --dry-run do not perform actions, just print output
530
530
531 global options ([+] can be repeated):
531 global options ([+] can be repeated):
532
532
533 -R --repository REPO repository root directory or name of overlay bundle
533 -R --repository REPO repository root directory or name of overlay bundle
534 file
534 file
535 --cwd DIR change working directory
535 --cwd DIR change working directory
536 -y --noninteractive do not prompt, automatically pick the first choice for
536 -y --noninteractive do not prompt, automatically pick the first choice for
537 all prompts
537 all prompts
538 -q --quiet suppress output
538 -q --quiet suppress output
539 -v --verbose enable additional output
539 -v --verbose enable additional output
540 --color TYPE when to colorize (boolean, always, auto, never, or
540 --color TYPE when to colorize (boolean, always, auto, never, or
541 debug)
541 debug)
542 --config CONFIG [+] set/override config option (use 'section.name=value')
542 --config CONFIG [+] set/override config option (use 'section.name=value')
543 --debug enable debugging output
543 --debug enable debugging output
544 --debugger start debugger
544 --debugger start debugger
545 --encoding ENCODE set the charset encoding (default: ascii)
545 --encoding ENCODE set the charset encoding (default: ascii)
546 --encodingmode MODE set the charset encoding mode (default: strict)
546 --encodingmode MODE set the charset encoding mode (default: strict)
547 --traceback always print a traceback on exception
547 --traceback always print a traceback on exception
548 --time time how long the command takes
548 --time time how long the command takes
549 --profile print command execution profile
549 --profile print command execution profile
550 --version output version information and exit
550 --version output version information and exit
551 -h --help display help and exit
551 -h --help display help and exit
552 --hidden consider hidden changesets
552 --hidden consider hidden changesets
553 --pager TYPE when to paginate (boolean, always, auto, or never)
553 --pager TYPE when to paginate (boolean, always, auto, or never)
554 (default: auto)
554 (default: auto)
555
555
556 Test the textwidth config option
556 Test the textwidth config option
557
557
558 $ hg root -h --config ui.textwidth=50
558 $ hg root -h --config ui.textwidth=50
559 hg root
559 hg root
560
560
561 print the root (top) of the current working
561 print the root (top) of the current working
562 directory
562 directory
563
563
564 Print the root directory of the current
564 Print the root directory of the current
565 repository.
565 repository.
566
566
567 Returns 0 on success.
567 Returns 0 on success.
568
568
569 options:
569 options:
570
570
571 -T --template TEMPLATE display with template
571 -T --template TEMPLATE display with template
572
572
573 (some details hidden, use --verbose to show
573 (some details hidden, use --verbose to show
574 complete help)
574 complete help)
575
575
576 Test help option with version option
576 Test help option with version option
577
577
578 $ hg add -h --version
578 $ hg add -h --version
579 Mercurial Distributed SCM (version *) (glob)
579 Mercurial Distributed SCM (version *) (glob)
580 (see https://mercurial-scm.org for more information)
580 (see https://mercurial-scm.org for more information)
581
581
582 Copyright (C) 2005-* Olivia Mackall and others (glob)
582 Copyright (C) 2005-* Olivia Mackall and others (glob)
583 This is free software; see the source for copying conditions. There is NO
583 This is free software; see the source for copying conditions. There is NO
584 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
584 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
585
585
586 $ hg add --skjdfks
586 $ hg add --skjdfks
587 hg add: option --skjdfks not recognized
587 hg add: option --skjdfks not recognized
588 hg add [OPTION]... [FILE]...
588 hg add [OPTION]... [FILE]...
589
589
590 add the specified files on the next commit
590 add the specified files on the next commit
591
591
592 options ([+] can be repeated):
592 options ([+] can be repeated):
593
593
594 -I --include PATTERN [+] include names matching the given patterns
594 -I --include PATTERN [+] include names matching the given patterns
595 -X --exclude PATTERN [+] exclude names matching the given patterns
595 -X --exclude PATTERN [+] exclude names matching the given patterns
596 -S --subrepos recurse into subrepositories
596 -S --subrepos recurse into subrepositories
597 -n --dry-run do not perform actions, just print output
597 -n --dry-run do not perform actions, just print output
598
598
599 (use 'hg add -h' to show more help)
599 (use 'hg add -h' to show more help)
600 [10]
600 [10]
601
601
602 Test ambiguous command help
602 Test ambiguous command help
603
603
604 $ hg help ad
604 $ hg help ad
605 list of commands:
605 list of commands:
606
606
607 add add the specified files on the next commit
607 add add the specified files on the next commit
608 addremove add all new files, delete all missing files
608 addremove add all new files, delete all missing files
609
609
610 (use 'hg help -v ad' to show built-in aliases and global options)
610 (use 'hg help -v ad' to show built-in aliases and global options)
611
611
612 Test command without options
612 Test command without options
613
613
614 $ hg help verify
614 $ hg help verify
615 hg verify
615 hg verify
616
616
617 verify the integrity of the repository
617 verify the integrity of the repository
618
618
619 Verify the integrity of the current repository.
619 Verify the integrity of the current repository.
620
620
621 This will perform an extensive check of the repository's integrity,
621 This will perform an extensive check of the repository's integrity,
622 validating the hashes and checksums of each entry in the changelog,
622 validating the hashes and checksums of each entry in the changelog,
623 manifest, and tracked files, as well as the integrity of their crosslinks
623 manifest, and tracked files, as well as the integrity of their crosslinks
624 and indices.
624 and indices.
625
625
626 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
626 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
627 information about recovery from corruption of the repository.
627 information about recovery from corruption of the repository.
628
628
629 Returns 0 on success, 1 if errors are encountered.
629 Returns 0 on success, 1 if errors are encountered.
630
630
631 options:
631 options:
632
632
633 (some details hidden, use --verbose to show complete help)
633 (some details hidden, use --verbose to show complete help)
634
634
635 $ hg help diff
635 $ hg help diff
636 hg diff [OPTION]... ([-c REV] | [--from REV1] [--to REV2]) [FILE]...
636 hg diff [OPTION]... ([-c REV] | [--from REV1] [--to REV2]) [FILE]...
637
637
638 diff repository (or selected files)
638 diff repository (or selected files)
639
639
640 Show differences between revisions for the specified files.
640 Show differences between revisions for the specified files.
641
641
642 Differences between files are shown using the unified diff format.
642 Differences between files are shown using the unified diff format.
643
643
644 Note:
644 Note:
645 'hg diff' may generate unexpected results for merges, as it will
645 'hg diff' may generate unexpected results for merges, as it will
646 default to comparing against the working directory's first parent
646 default to comparing against the working directory's first parent
647 changeset if no revisions are specified. To diff against the conflict
647 changeset if no revisions are specified. To diff against the conflict
648 regions, you can use '--config diff.merge=yes'.
648 regions, you can use '--config diff.merge=yes'.
649
649
650 By default, the working directory files are compared to its first parent.
650 By default, the working directory files are compared to its first parent.
651 To see the differences from another revision, use --from. To see the
651 To see the differences from another revision, use --from. To see the
652 difference to another revision, use --to. For example, 'hg diff --from .^'
652 difference to another revision, use --to. For example, 'hg diff --from .^'
653 will show the differences from the working copy's grandparent to the
653 will show the differences from the working copy's grandparent to the
654 working copy, 'hg diff --to .' will show the diff from the working copy to
654 working copy, 'hg diff --to .' will show the diff from the working copy to
655 its parent (i.e. the reverse of the default), and 'hg diff --from 1.0 --to
655 its parent (i.e. the reverse of the default), and 'hg diff --from 1.0 --to
656 1.2' will show the diff between those two revisions.
656 1.2' will show the diff between those two revisions.
657
657
658 Alternatively you can specify -c/--change with a revision to see the
658 Alternatively you can specify -c/--change with a revision to see the
659 changes in that changeset relative to its first parent (i.e. 'hg diff -c
659 changes in that changeset relative to its first parent (i.e. 'hg diff -c
660 42' is equivalent to 'hg diff --from 42^ --to 42')
660 42' is equivalent to 'hg diff --from 42^ --to 42')
661
661
662 Without the -a/--text option, diff will avoid generating diffs of files it
662 Without the -a/--text option, diff will avoid generating diffs of files it
663 detects as binary. With -a, diff will generate a diff anyway, probably
663 detects as binary. With -a, diff will generate a diff anyway, probably
664 with undesirable results.
664 with undesirable results.
665
665
666 Use the -g/--git option to generate diffs in the git extended diff format.
666 Use the -g/--git option to generate diffs in the git extended diff format.
667 For more information, read 'hg help diffs'.
667 For more information, read 'hg help diffs'.
668
668
669 Returns 0 on success.
669 Returns 0 on success.
670
670
671 options ([+] can be repeated):
671 options ([+] can be repeated):
672
672
673 --from REV1 revision to diff from
673 --from REV1 revision to diff from
674 --to REV2 revision to diff to
674 --to REV2 revision to diff to
675 -c --change REV change made by revision
675 -c --change REV change made by revision
676 -a --text treat all files as text
676 -a --text treat all files as text
677 -g --git use git extended diff format
677 -g --git use git extended diff format
678 --binary generate binary diffs in git mode (default)
678 --binary generate binary diffs in git mode (default)
679 --nodates omit dates from diff headers
679 --nodates omit dates from diff headers
680 --noprefix omit a/ and b/ prefixes from filenames
680 --noprefix omit a/ and b/ prefixes from filenames
681 -p --show-function show which function each change is in
681 -p --show-function show which function each change is in
682 --reverse produce a diff that undoes the changes
682 --reverse produce a diff that undoes the changes
683 -w --ignore-all-space ignore white space when comparing lines
683 -w --ignore-all-space ignore white space when comparing lines
684 -b --ignore-space-change ignore changes in the amount of white space
684 -b --ignore-space-change ignore changes in the amount of white space
685 -B --ignore-blank-lines ignore changes whose lines are all blank
685 -B --ignore-blank-lines ignore changes whose lines are all blank
686 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
686 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
687 -U --unified NUM number of lines of context to show
687 -U --unified NUM number of lines of context to show
688 --stat output diffstat-style summary of changes
688 --stat output diffstat-style summary of changes
689 --root DIR produce diffs relative to subdirectory
689 --root DIR produce diffs relative to subdirectory
690 -I --include PATTERN [+] include names matching the given patterns
690 -I --include PATTERN [+] include names matching the given patterns
691 -X --exclude PATTERN [+] exclude names matching the given patterns
691 -X --exclude PATTERN [+] exclude names matching the given patterns
692 -S --subrepos recurse into subrepositories
692 -S --subrepos recurse into subrepositories
693
693
694 (some details hidden, use --verbose to show complete help)
694 (some details hidden, use --verbose to show complete help)
695
695
696 $ hg help status
696 $ hg help status
697 hg status [OPTION]... [FILE]...
697 hg status [OPTION]... [FILE]...
698
698
699 aliases: st
699 aliases: st
700
700
701 show changed files in the working directory
701 show changed files in the working directory
702
702
703 Show status of files in the repository. If names are given, only files
703 Show status of files in the repository. If names are given, only files
704 that match are shown. Files that are clean or ignored or the source of a
704 that match are shown. Files that are clean or ignored or the source of a
705 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
705 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
706 -C/--copies or -A/--all are given. Unless options described with "show
706 -C/--copies or -A/--all are given. Unless options described with "show
707 only ..." are given, the options -mardu are used.
707 only ..." are given, the options -mardu are used.
708
708
709 Option -q/--quiet hides untracked (unknown and ignored) files unless
709 Option -q/--quiet hides untracked (unknown and ignored) files unless
710 explicitly requested with -u/--unknown or -i/--ignored.
710 explicitly requested with -u/--unknown or -i/--ignored.
711
711
712 Note:
712 Note:
713 'hg status' may appear to disagree with diff if permissions have
713 'hg status' may appear to disagree with diff if permissions have
714 changed or a merge has occurred. The standard diff format does not
714 changed or a merge has occurred. The standard diff format does not
715 report permission changes and diff only reports changes relative to one
715 report permission changes and diff only reports changes relative to one
716 merge parent.
716 merge parent.
717
717
718 If one revision is given, it is used as the base revision. If two
718 If one revision is given, it is used as the base revision. If two
719 revisions are given, the differences between them are shown. The --change
719 revisions are given, the differences between them are shown. The --change
720 option can also be used as a shortcut to list the changed files of a
720 option can also be used as a shortcut to list the changed files of a
721 revision from its first parent.
721 revision from its first parent.
722
722
723 The codes used to show the status of files are:
723 The codes used to show the status of files are:
724
724
725 M = modified
725 M = modified
726 A = added
726 A = added
727 R = removed
727 R = removed
728 C = clean
728 C = clean
729 ! = missing (deleted by non-hg command, but still tracked)
729 ! = missing (deleted by non-hg command, but still tracked)
730 ? = not tracked
730 ? = not tracked
731 I = ignored
731 I = ignored
732 = origin of the previous file (with --copies)
732 = origin of the previous file (with --copies)
733
733
734 Returns 0 on success.
734 Returns 0 on success.
735
735
736 options ([+] can be repeated):
736 options ([+] can be repeated):
737
737
738 -A --all show status of all files
738 -A --all show status of all files
739 -m --modified show only modified files
739 -m --modified show only modified files
740 -a --added show only added files
740 -a --added show only added files
741 -r --removed show only removed files
741 -r --removed show only removed files
742 -d --deleted show only missing files
742 -d --deleted show only missing files
743 -c --clean show only files without changes
743 -c --clean show only files without changes
744 -u --unknown show only unknown (not tracked) files
744 -u --unknown show only unknown (not tracked) files
745 -i --ignored show only ignored files
745 -i --ignored show only ignored files
746 -n --no-status hide status prefix
746 -n --no-status hide status prefix
747 -C --copies show source of copied files
747 -C --copies show source of copied files
748 -0 --print0 end filenames with NUL, for use with xargs
748 -0 --print0 end filenames with NUL, for use with xargs
749 --rev REV [+] show difference from revision
749 --rev REV [+] show difference from revision
750 --change REV list the changed files of a revision
750 --change REV list the changed files of a revision
751 -I --include PATTERN [+] include names matching the given patterns
751 -I --include PATTERN [+] include names matching the given patterns
752 -X --exclude PATTERN [+] exclude names matching the given patterns
752 -X --exclude PATTERN [+] exclude names matching the given patterns
753 -S --subrepos recurse into subrepositories
753 -S --subrepos recurse into subrepositories
754 -T --template TEMPLATE display with template
754 -T --template TEMPLATE display with template
755
755
756 (some details hidden, use --verbose to show complete help)
756 (some details hidden, use --verbose to show complete help)
757
757
758 $ hg -q help status
758 $ hg -q help status
759 hg status [OPTION]... [FILE]...
759 hg status [OPTION]... [FILE]...
760
760
761 show changed files in the working directory
761 show changed files in the working directory
762
762
763 $ hg help foo
763 $ hg help foo
764 abort: no such help topic: foo
764 abort: no such help topic: foo
765 (try 'hg help --keyword foo')
765 (try 'hg help --keyword foo')
766 [10]
766 [10]
767
767
768 $ hg skjdfks
768 $ hg skjdfks
769 hg: unknown command 'skjdfks'
769 hg: unknown command 'skjdfks'
770 (use 'hg help' for a list of commands)
770 (use 'hg help' for a list of commands)
771 [10]
771 [10]
772
772
773 Typoed command gives suggestion
773 Typoed command gives suggestion
774 $ hg puls
774 $ hg puls
775 hg: unknown command 'puls'
775 hg: unknown command 'puls'
776 (did you mean one of pull, push?)
776 (did you mean one of pull, push?)
777 [10]
777 [10]
778
778
779 Not enabled extension gets suggested
779 Not enabled extension gets suggested
780
780
781 $ hg rebase
781 $ hg rebase
782 hg: unknown command 'rebase'
782 hg: unknown command 'rebase'
783 'rebase' is provided by the following extension:
783 'rebase' is provided by the following extension:
784
784
785 rebase command to move sets of revisions to a different ancestor
785 rebase command to move sets of revisions to a different ancestor
786
786
787 (use 'hg help extensions' for information on enabling extensions)
787 (use 'hg help extensions' for information on enabling extensions)
788 [10]
788 [10]
789
789
790 Disabled extension gets suggested
790 Disabled extension gets suggested
791 $ hg --config extensions.rebase=! rebase
791 $ hg --config extensions.rebase=! rebase
792 hg: unknown command 'rebase'
792 hg: unknown command 'rebase'
793 'rebase' is provided by the following extension:
793 'rebase' is provided by the following extension:
794
794
795 rebase command to move sets of revisions to a different ancestor
795 rebase command to move sets of revisions to a different ancestor
796
796
797 (use 'hg help extensions' for information on enabling extensions)
797 (use 'hg help extensions' for information on enabling extensions)
798 [10]
798 [10]
799
799
800 Checking that help adapts based on the config:
800 Checking that help adapts based on the config:
801
801
802 $ hg help diff --config ui.tweakdefaults=true | egrep -e '^ *(-g|config)'
802 $ hg help diff --config ui.tweakdefaults=true | egrep -e '^ *(-g|config)'
803 -g --[no-]git use git extended diff format (default: on from
803 -g --[no-]git use git extended diff format (default: on from
804 config)
804 config)
805
805
806 Make sure that we don't run afoul of the help system thinking that
806 Make sure that we don't run afoul of the help system thinking that
807 this is a section and erroring out weirdly.
807 this is a section and erroring out weirdly.
808
808
809 $ hg .log
809 $ hg .log
810 hg: unknown command '.log'
810 hg: unknown command '.log'
811 (did you mean log?)
811 (did you mean log?)
812 [10]
812 [10]
813
813
814 $ hg log.
814 $ hg log.
815 hg: unknown command 'log.'
815 hg: unknown command 'log.'
816 (did you mean log?)
816 (did you mean log?)
817 [10]
817 [10]
818 $ hg pu.lh
818 $ hg pu.lh
819 hg: unknown command 'pu.lh'
819 hg: unknown command 'pu.lh'
820 (did you mean one of pull, push?)
820 (did you mean one of pull, push?)
821 [10]
821 [10]
822
822
823 $ cat > helpext.py <<EOF
823 $ cat > helpext.py <<EOF
824 > import os
824 > import os
825 > from mercurial import commands, fancyopts, registrar
825 > from mercurial import commands, fancyopts, registrar
826 >
826 >
827 > def func(arg):
827 > def func(arg):
828 > return '%sfoo' % arg
828 > return '%sfoo' % arg
829 > class customopt(fancyopts.customopt):
829 > class customopt(fancyopts.customopt):
830 > def newstate(self, oldstate, newparam, abort):
830 > def newstate(self, oldstate, newparam, abort):
831 > return '%sbar' % oldstate
831 > return '%sbar' % oldstate
832 > cmdtable = {}
832 > cmdtable = {}
833 > command = registrar.command(cmdtable)
833 > command = registrar.command(cmdtable)
834 >
834 >
835 > @command(b'nohelp',
835 > @command(b'nohelp',
836 > [(b'', b'longdesc', 3, b'x'*67),
836 > [(b'', b'longdesc', 3, b'x'*67),
837 > (b'n', b'', None, b'normal desc'),
837 > (b'n', b'', None, b'normal desc'),
838 > (b'', b'newline', b'', b'line1\nline2'),
838 > (b'', b'newline', b'', b'line1\nline2'),
839 > (b'', b'default-off', False, b'enable X'),
839 > (b'', b'default-off', False, b'enable X'),
840 > (b'', b'default-on', True, b'enable Y'),
840 > (b'', b'default-on', True, b'enable Y'),
841 > (b'', b'callableopt', func, b'adds foo'),
841 > (b'', b'callableopt', func, b'adds foo'),
842 > (b'', b'customopt', customopt(''), b'adds bar'),
842 > (b'', b'customopt', customopt(''), b'adds bar'),
843 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
843 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
844 > b'hg nohelp',
844 > b'hg nohelp',
845 > norepo=True)
845 > norepo=True)
846 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
846 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
847 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
847 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
848 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
848 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
849 > def nohelp(ui, *args, **kwargs):
849 > def nohelp(ui, *args, **kwargs):
850 > pass
850 > pass
851 >
851 >
852 > @command(b'hashelp', [], b'hg hashelp', norepo=True)
852 > @command(b'hashelp', [], b'hg hashelp', norepo=True)
853 > def hashelp(ui, *args, **kwargs):
853 > def hashelp(ui, *args, **kwargs):
854 > """Extension command's help"""
854 > """Extension command's help"""
855 >
855 >
856 > def uisetup(ui):
856 > def uisetup(ui):
857 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
857 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
858 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
858 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
859 > ui.setconfig(b'alias', b'hgalias:doc', b'My doc', b'helpext')
859 > ui.setconfig(b'alias', b'hgalias:doc', b'My doc', b'helpext')
860 > ui.setconfig(b'alias', b'hgalias:category', b'navigation', b'helpext')
860 > ui.setconfig(b'alias', b'hgalias:category', b'navigation', b'helpext')
861 > ui.setconfig(b'alias', b'hgaliasnodoc', b'summary', b'helpext')
861 > ui.setconfig(b'alias', b'hgaliasnodoc', b'summary', b'helpext')
862 >
862 >
863 > EOF
863 > EOF
864 $ echo '[extensions]' >> $HGRCPATH
864 $ echo '[extensions]' >> $HGRCPATH
865 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
865 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
866
866
867 Test for aliases
867 Test for aliases
868
868
869 $ hg help | grep hgalias
869 $ hg help | grep hgalias
870 hgalias My doc
870 hgalias My doc
871
871
872 $ hg help hgalias
872 $ hg help hgalias
873 hg hgalias [--remote]
873 hg hgalias [--remote]
874
874
875 alias for: hg summary
875 alias for: hg summary
876
876
877 My doc
877 My doc
878
878
879 defined by: helpext
879 defined by: helpext
880
880
881 options:
881 options:
882
882
883 --remote check for push and pull
883 --remote check for push and pull
884
884
885 (some details hidden, use --verbose to show complete help)
885 (some details hidden, use --verbose to show complete help)
886 $ hg help hgaliasnodoc
886 $ hg help hgaliasnodoc
887 hg hgaliasnodoc [--remote]
887 hg hgaliasnodoc [--remote]
888
888
889 alias for: hg summary
889 alias for: hg summary
890
890
891 summarize working directory state
891 summarize working directory state
892
892
893 This generates a brief summary of the working directory state, including
893 This generates a brief summary of the working directory state, including
894 parents, branch, commit status, phase and available updates.
894 parents, branch, commit status, phase and available updates.
895
895
896 With the --remote option, this will check the default paths for incoming
896 With the --remote option, this will check the default paths for incoming
897 and outgoing changes. This can be time-consuming.
897 and outgoing changes. This can be time-consuming.
898
898
899 Returns 0 on success.
899 Returns 0 on success.
900
900
901 defined by: helpext
901 defined by: helpext
902
902
903 options:
903 options:
904
904
905 --remote check for push and pull
905 --remote check for push and pull
906
906
907 (some details hidden, use --verbose to show complete help)
907 (some details hidden, use --verbose to show complete help)
908
908
909 $ hg help shellalias
909 $ hg help shellalias
910 hg shellalias
910 hg shellalias
911
911
912 shell alias for: echo hi
912 shell alias for: echo hi
913
913
914 (no help text available)
914 (no help text available)
915
915
916 defined by: helpext
916 defined by: helpext
917
917
918 (some details hidden, use --verbose to show complete help)
918 (some details hidden, use --verbose to show complete help)
919
919
920 Test command with no help text
920 Test command with no help text
921
921
922 $ hg help nohelp
922 $ hg help nohelp
923 hg nohelp
923 hg nohelp
924
924
925 (no help text available)
925 (no help text available)
926
926
927 options:
927 options:
928
928
929 --longdesc VALUE
929 --longdesc VALUE
930 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
930 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
931 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
931 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
932 -n -- normal desc
932 -n -- normal desc
933 --newline VALUE line1 line2
933 --newline VALUE line1 line2
934 --default-off enable X
934 --default-off enable X
935 --[no-]default-on enable Y (default: on)
935 --[no-]default-on enable Y (default: on)
936 --callableopt VALUE adds foo
936 --callableopt VALUE adds foo
937 --customopt VALUE adds bar
937 --customopt VALUE adds bar
938 --customopt-withdefault VALUE adds bar (default: foo)
938 --customopt-withdefault VALUE adds bar (default: foo)
939
939
940 (some details hidden, use --verbose to show complete help)
940 (some details hidden, use --verbose to show complete help)
941
941
942 Test that default list of commands includes extension commands that have help,
942 Test that default list of commands includes extension commands that have help,
943 but not those that don't, except in verbose mode, when a keyword is passed, or
943 but not those that don't, except in verbose mode, when a keyword is passed, or
944 when help about the extension is requested.
944 when help about the extension is requested.
945
945
946 #if no-extraextensions
946 #if no-extraextensions
947
947
948 $ hg help | grep hashelp
948 $ hg help | grep hashelp
949 hashelp Extension command's help
949 hashelp Extension command's help
950 $ hg help | grep nohelp
950 $ hg help | grep nohelp
951 [1]
951 [1]
952 $ hg help -v | grep nohelp
952 $ hg help -v | grep nohelp
953 nohelp (no help text available)
953 nohelp (no help text available)
954
954
955 $ hg help -k nohelp
955 $ hg help -k nohelp
956 Commands:
956 Commands:
957
957
958 nohelp hg nohelp
958 nohelp hg nohelp
959
959
960 Extension Commands:
960 Extension Commands:
961
961
962 nohelp (no help text available)
962 nohelp (no help text available)
963
963
964 $ hg help helpext
964 $ hg help helpext
965 helpext extension - no help text available
965 helpext extension - no help text available
966
966
967 list of commands:
967 list of commands:
968
968
969 hashelp Extension command's help
969 hashelp Extension command's help
970 nohelp (no help text available)
970 nohelp (no help text available)
971
971
972 (use 'hg help -v helpext' to show built-in aliases and global options)
972 (use 'hg help -v helpext' to show built-in aliases and global options)
973
973
974 #endif
974 #endif
975
975
976 Test list of internal help commands
976 Test list of internal help commands
977
977
978 $ hg help debug
978 $ hg help debug
979 debug commands (internal and unsupported):
979 debug commands (internal and unsupported):
980
980
981 debug-delta-find
981 debug-delta-find
982 display the computation to get to a valid delta for storing REV
982 display the computation to get to a valid delta for storing REV
983 debug-repair-issue6528
983 debug-repair-issue6528
984 find affected revisions and repair them. See issue6528 for more
984 find affected revisions and repair them. See issue6528 for more
985 details.
985 details.
986 debug-revlog-index
986 debug-revlog-index
987 dump index data for a revlog
987 dump index data for a revlog
988 debug-revlog-stats
988 debug-revlog-stats
989 display statistics about revlogs in the store
989 display statistics about revlogs in the store
990 debug::stable-tail-sort
990 debug::stable-tail-sort
991 display the stable-tail sort of the ancestors of a given node
991 display the stable-tail sort of the ancestors of a given node
992 debugancestor
992 debugancestor
993 find the ancestor revision of two revisions in a given index
993 find the ancestor revision of two revisions in a given index
994 debugantivirusrunning
994 debugantivirusrunning
995 attempt to trigger an antivirus scanner to see if one is active
995 attempt to trigger an antivirus scanner to see if one is active
996 debugapplystreamclonebundle
996 debugapplystreamclonebundle
997 apply a stream clone bundle file
997 apply a stream clone bundle file
998 debugbackupbundle
998 debugbackupbundle
999 lists the changesets available in backup bundles
999 lists the changesets available in backup bundles
1000 debugbuilddag
1000 debugbuilddag
1001 builds a repo with a given DAG from scratch in the current
1001 builds a repo with a given DAG from scratch in the current
1002 empty repo
1002 empty repo
1003 debugbundle lists the contents of a bundle
1003 debugbundle lists the contents of a bundle
1004 debugcapabilities
1004 debugcapabilities
1005 lists the capabilities of a remote peer
1005 lists the capabilities of a remote peer
1006 debugchangedfiles
1006 debugchangedfiles
1007 list the stored files changes for a revision
1007 list the stored files changes for a revision
1008 debugcheckstate
1008 debugcheckstate
1009 validate the correctness of the current dirstate
1009 validate the correctness of the current dirstate
1010 debugcolor show available color, effects or style
1010 debugcolor show available color, effects or style
1011 debugcommands
1011 debugcommands
1012 list all available commands and options
1012 list all available commands and options
1013 debugcomplete
1013 debugcomplete
1014 returns the completion list associated with the given command
1014 returns the completion list associated with the given command
1015 debugcreatestreamclonebundle
1015 debugcreatestreamclonebundle
1016 create a stream clone bundle file
1016 create a stream clone bundle file
1017 debugdag format the changelog or an index DAG as a concise textual
1017 debugdag format the changelog or an index DAG as a concise textual
1018 description
1018 description
1019 debugdata dump the contents of a data file revision
1019 debugdata dump the contents of a data file revision
1020 debugdate parse and display a date
1020 debugdate parse and display a date
1021 debugdeltachain
1021 debugdeltachain
1022 dump information about delta chains in a revlog
1022 dump information about delta chains in a revlog
1023 debugdirstate
1023 debugdirstate
1024 show the contents of the current dirstate
1024 show the contents of the current dirstate
1025 debugdirstateignorepatternshash
1025 debugdirstateignorepatternshash
1026 show the hash of ignore patterns stored in dirstate if v2,
1026 show the hash of ignore patterns stored in dirstate if v2,
1027 debugdiscovery
1027 debugdiscovery
1028 runs the changeset discovery protocol in isolation
1028 runs the changeset discovery protocol in isolation
1029 debugdownload
1029 debugdownload
1030 download a resource using Mercurial logic and config
1030 download a resource using Mercurial logic and config
1031 debugextensions
1031 debugextensions
1032 show information about active extensions
1032 show information about active extensions
1033 debugfileset parse and apply a fileset specification
1033 debugfileset parse and apply a fileset specification
1034 debugformat display format information about the current repository
1034 debugformat display format information about the current repository
1035 debugfsinfo show information detected about current filesystem
1035 debugfsinfo show information detected about current filesystem
1036 debuggetbundle
1036 debuggetbundle
1037 retrieves a bundle from a repo
1037 retrieves a bundle from a repo
1038 debugignore display the combined ignore pattern and information about
1038 debugignore display the combined ignore pattern and information about
1039 ignored files
1039 ignored files
1040 debugindexdot
1040 debugindexdot
1041 dump an index DAG as a graphviz dot file
1041 dump an index DAG as a graphviz dot file
1042 debugindexstats
1042 debugindexstats
1043 show stats related to the changelog index
1043 show stats related to the changelog index
1044 debuginstall test Mercurial installation
1044 debuginstall test Mercurial installation
1045 debugknown test whether node ids are known to a repo
1045 debugknown test whether node ids are known to a repo
1046 debuglocks show or modify state of locks
1046 debuglocks show or modify state of locks
1047 debugmanifestfulltextcache
1047 debugmanifestfulltextcache
1048 show, clear or amend the contents of the manifest fulltext
1048 show, clear or amend the contents of the manifest fulltext
1049 cache
1049 cache
1050 debugmergestate
1050 debugmergestate
1051 print merge state
1051 print merge state
1052 debugnamecomplete
1052 debugnamecomplete
1053 complete "names" - tags, open branch names, bookmark names
1053 complete "names" - tags, open branch names, bookmark names
1054 debugnodemap write and inspect on disk nodemap
1054 debugnodemap write and inspect on disk nodemap
1055 debugobsolete
1055 debugobsolete
1056 create arbitrary obsolete marker
1056 create arbitrary obsolete marker
1057 debugoptADV (no help text available)
1057 debugoptADV (no help text available)
1058 debugoptDEP (no help text available)
1058 debugoptDEP (no help text available)
1059 debugoptEXP (no help text available)
1059 debugoptEXP (no help text available)
1060 debugp1copies
1060 debugp1copies
1061 dump copy information compared to p1
1061 dump copy information compared to p1
1062 debugp2copies
1062 debugp2copies
1063 dump copy information compared to p2
1063 dump copy information compared to p2
1064 debugpathcomplete
1064 debugpathcomplete
1065 complete part or all of a tracked path
1065 complete part or all of a tracked path
1066 debugpathcopies
1066 debugpathcopies
1067 show copies between two revisions
1067 show copies between two revisions
1068 debugpeer establish a connection to a peer repository
1068 debugpeer establish a connection to a peer repository
1069 debugpickmergetool
1069 debugpickmergetool
1070 examine which merge tool is chosen for specified file
1070 examine which merge tool is chosen for specified file
1071 debugpushkey access the pushkey key/value protocol
1071 debugpushkey access the pushkey key/value protocol
1072 debugpvec (no help text available)
1072 debugpvec (no help text available)
1073 debugrebuilddirstate
1073 debugrebuilddirstate
1074 rebuild the dirstate as it would look like for the given
1074 rebuild the dirstate as it would look like for the given
1075 revision
1075 revision
1076 debugrebuildfncache
1076 debugrebuildfncache
1077 rebuild the fncache file
1077 rebuild the fncache file
1078 debugrename dump rename information
1078 debugrename dump rename information
1079 debugrequires
1079 debugrequires
1080 print the current repo requirements
1080 print the current repo requirements
1081 debugrevlog show data and statistics about a revlog
1081 debugrevlog show data and statistics about a revlog
1082 debugrevlogindex
1082 debugrevlogindex
1083 dump the contents of a revlog index
1083 dump the contents of a revlog index
1084 debugrevspec parse and apply a revision specification
1084 debugrevspec parse and apply a revision specification
1085 debugserve run a server with advanced settings
1085 debugserve run a server with advanced settings
1086 debugsetparents
1086 debugsetparents
1087 manually set the parents of the current working directory
1087 manually set the parents of the current working directory
1088 (DANGEROUS)
1088 (DANGEROUS)
1089 debugshell run an interactive Python interpreter
1089 debugshell run an interactive Python interpreter
1090 debugsidedata
1090 debugsidedata
1091 dump the side data for a cl/manifest/file revision
1091 dump the side data for a cl/manifest/file revision
1092 debugssl test a secure connection to a server
1092 debugssl test a secure connection to a server
1093 debugstrip strip changesets and all their descendants from the repository
1093 debugstrip strip changesets and all their descendants from the repository
1094 debugsub (no help text available)
1094 debugsub (no help text available)
1095 debugsuccessorssets
1095 debugsuccessorssets
1096 show set of successors for revision
1096 show set of successors for revision
1097 debugtagscache
1097 debugtagscache
1098 display the contents of .hg/cache/hgtagsfnodes1
1098 display the contents of .hg/cache/hgtagsfnodes1
1099 debugtemplate
1099 debugtemplate
1100 parse and apply a template
1100 parse and apply a template
1101 debuguigetpass
1101 debuguigetpass
1102 show prompt to type password
1102 show prompt to type password
1103 debuguiprompt
1103 debuguiprompt
1104 show plain prompt
1104 show plain prompt
1105 debugupdatecaches
1105 debugupdatecaches
1106 warm all known caches in the repository
1106 warm all known caches in the repository
1107 debugupgraderepo
1107 debugupgraderepo
1108 upgrade a repository to use different features
1108 upgrade a repository to use different features
1109 debugwalk show how files match on given patterns
1109 debugwalk show how files match on given patterns
1110 debugwhyunstable
1110 debugwhyunstable
1111 explain instabilities of a changeset
1111 explain instabilities of a changeset
1112 debugwireargs
1112 debugwireargs
1113 (no help text available)
1113 (no help text available)
1114 debugwireproto
1114 debugwireproto
1115 send wire protocol commands to a server
1115 send wire protocol commands to a server
1116
1116
1117 (use 'hg help -v debug' to show built-in aliases and global options)
1117 (use 'hg help -v debug' to show built-in aliases and global options)
1118
1118
1119 internals topic renders index of available sub-topics
1119 internals topic renders index of available sub-topics
1120
1120
1121 $ hg help internals
1121 $ hg help internals
1122 Technical implementation topics
1122 Technical implementation topics
1123 """""""""""""""""""""""""""""""
1123 """""""""""""""""""""""""""""""
1124
1124
1125 To access a subtopic, use "hg help internals.{subtopic-name}"
1125 To access a subtopic, use "hg help internals.{subtopic-name}"
1126
1126
1127 bid-merge Bid Merge Algorithm
1127 bid-merge Bid Merge Algorithm
1128 bundle2 Bundle2
1128 bundle2 Bundle2
1129 bundles Bundles
1129 bundles Bundles
1130 cbor CBOR
1130 cbor CBOR
1131 censor Censor
1131 censor Censor
1132 changegroups Changegroups
1132 changegroups Changegroups
1133 config Config Registrar
1133 config Config Registrar
1134 dirstate-v2 dirstate-v2 file format
1134 dirstate-v2 dirstate-v2 file format
1135 extensions Extension API
1135 extensions Extension API
1136 mergestate Mergestate
1136 mergestate Mergestate
1137 requirements Repository Requirements
1137 requirements Repository Requirements
1138 revlogs Revision Logs
1138 revlogs Revision Logs
1139 wireprotocol Wire Protocol
1139 wireprotocol Wire Protocol
1140 wireprotocolrpc
1140 wireprotocolrpc
1141 Wire Protocol RPC
1141 Wire Protocol RPC
1142 wireprotocolv2
1142 wireprotocolv2
1143 Wire Protocol Version 2
1143 Wire Protocol Version 2
1144
1144
1145 sub-topics can be accessed
1145 sub-topics can be accessed
1146
1146
1147 $ hg help internals.changegroups
1147 $ hg help internals.changegroups
1148 Changegroups
1148 Changegroups
1149 """"""""""""
1149 """"""""""""
1150
1150
1151 Changegroups are representations of repository revlog data, specifically
1151 Changegroups are representations of repository revlog data, specifically
1152 the changelog data, root/flat manifest data, treemanifest data, and
1152 the changelog data, root/flat manifest data, treemanifest data, and
1153 filelogs.
1153 filelogs.
1154
1154
1155 There are 4 versions of changegroups: "1", "2", "3" and "4". From a high-
1155 There are 4 versions of changegroups: "1", "2", "3" and "4". From a high-
1156 level, versions "1" and "2" are almost exactly the same, with the only
1156 level, versions "1" and "2" are almost exactly the same, with the only
1157 difference being an additional item in the *delta header*. Version "3"
1157 difference being an additional item in the *delta header*. Version "3"
1158 adds support for storage flags in the *delta header* and optionally
1158 adds support for storage flags in the *delta header* and optionally
1159 exchanging treemanifests (enabled by setting an option on the
1159 exchanging treemanifests (enabled by setting an option on the
1160 "changegroup" part in the bundle2). Version "4" adds support for
1160 "changegroup" part in the bundle2). Version "4" adds support for
1161 exchanging sidedata (additional revision metadata not part of the digest).
1161 exchanging sidedata (additional revision metadata not part of the digest).
1162
1162
1163 Changegroups when not exchanging treemanifests consist of 3 logical
1163 Changegroups when not exchanging treemanifests consist of 3 logical
1164 segments:
1164 segments:
1165
1165
1166 +---------------------------------+
1166 +---------------------------------+
1167 | | | |
1167 | | | |
1168 | changeset | manifest | filelogs |
1168 | changeset | manifest | filelogs |
1169 | | | |
1169 | | | |
1170 | | | |
1170 | | | |
1171 +---------------------------------+
1171 +---------------------------------+
1172
1172
1173 When exchanging treemanifests, there are 4 logical segments:
1173 When exchanging treemanifests, there are 4 logical segments:
1174
1174
1175 +-------------------------------------------------+
1175 +-------------------------------------------------+
1176 | | | | |
1176 | | | | |
1177 | changeset | root | treemanifests | filelogs |
1177 | changeset | root | treemanifests | filelogs |
1178 | | manifest | | |
1178 | | manifest | | |
1179 | | | | |
1179 | | | | |
1180 +-------------------------------------------------+
1180 +-------------------------------------------------+
1181
1181
1182 The principle building block of each segment is a *chunk*. A *chunk* is a
1182 The principle building block of each segment is a *chunk*. A *chunk* is a
1183 framed piece of data:
1183 framed piece of data:
1184
1184
1185 +---------------------------------------+
1185 +---------------------------------------+
1186 | | |
1186 | | |
1187 | length | data |
1187 | length | data |
1188 | (4 bytes) | (<length - 4> bytes) |
1188 | (4 bytes) | (<length - 4> bytes) |
1189 | | |
1189 | | |
1190 +---------------------------------------+
1190 +---------------------------------------+
1191
1191
1192 All integers are big-endian signed integers. Each chunk starts with a
1192 All integers are big-endian signed integers. Each chunk starts with a
1193 32-bit integer indicating the length of the entire chunk (including the
1193 32-bit integer indicating the length of the entire chunk (including the
1194 length field itself).
1194 length field itself).
1195
1195
1196 There is a special case chunk that has a value of 0 for the length
1196 There is a special case chunk that has a value of 0 for the length
1197 ("0x00000000"). We call this an *empty chunk*.
1197 ("0x00000000"). We call this an *empty chunk*.
1198
1198
1199 Delta Groups
1199 Delta Groups
1200 ============
1200 ============
1201
1201
1202 A *delta group* expresses the content of a revlog as a series of deltas,
1202 A *delta group* expresses the content of a revlog as a series of deltas,
1203 or patches against previous revisions.
1203 or patches against previous revisions.
1204
1204
1205 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1205 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1206 to signal the end of the delta group:
1206 to signal the end of the delta group:
1207
1207
1208 +------------------------------------------------------------------------+
1208 +------------------------------------------------------------------------+
1209 | | | | | |
1209 | | | | | |
1210 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1210 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1211 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1211 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1212 | | | | | |
1212 | | | | | |
1213 +------------------------------------------------------------------------+
1213 +------------------------------------------------------------------------+
1214
1214
1215 Each *chunk*'s data consists of the following:
1215 Each *chunk*'s data consists of the following:
1216
1216
1217 +---------------------------------------+
1217 +---------------------------------------+
1218 | | |
1218 | | |
1219 | delta header | delta data |
1219 | delta header | delta data |
1220 | (various by version) | (various) |
1220 | (various by version) | (various) |
1221 | | |
1221 | | |
1222 +---------------------------------------+
1222 +---------------------------------------+
1223
1223
1224 The *delta data* is a series of *delta*s that describe a diff from an
1224 The *delta data* is a series of *delta*s that describe a diff from an
1225 existing entry (either that the recipient already has, or previously
1225 existing entry (either that the recipient already has, or previously
1226 specified in the bundle/changegroup).
1226 specified in the bundle/changegroup).
1227
1227
1228 The *delta header* is different between versions "1", "2", "3" and "4" of
1228 The *delta header* is different between versions "1", "2", "3" and "4" of
1229 the changegroup format.
1229 the changegroup format.
1230
1230
1231 Version 1 (headerlen=80):
1231 Version 1 (headerlen=80):
1232
1232
1233 +------------------------------------------------------+
1233 +------------------------------------------------------+
1234 | | | | |
1234 | | | | |
1235 | node | p1 node | p2 node | link node |
1235 | node | p1 node | p2 node | link node |
1236 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1236 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1237 | | | | |
1237 | | | | |
1238 +------------------------------------------------------+
1238 +------------------------------------------------------+
1239
1239
1240 Version 2 (headerlen=100):
1240 Version 2 (headerlen=100):
1241
1241
1242 +------------------------------------------------------------------+
1242 +------------------------------------------------------------------+
1243 | | | | | |
1243 | | | | | |
1244 | node | p1 node | p2 node | base node | link node |
1244 | node | p1 node | p2 node | base node | link node |
1245 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1245 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1246 | | | | | |
1246 | | | | | |
1247 +------------------------------------------------------------------+
1247 +------------------------------------------------------------------+
1248
1248
1249 Version 3 (headerlen=102):
1249 Version 3 (headerlen=102):
1250
1250
1251 +------------------------------------------------------------------------------+
1251 +------------------------------------------------------------------------------+
1252 | | | | | | |
1252 | | | | | | |
1253 | node | p1 node | p2 node | base node | link node | flags |
1253 | node | p1 node | p2 node | base node | link node | flags |
1254 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1254 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1255 | | | | | | |
1255 | | | | | | |
1256 +------------------------------------------------------------------------------+
1256 +------------------------------------------------------------------------------+
1257
1257
1258 Version 4 (headerlen=103):
1258 Version 4 (headerlen=103):
1259
1259
1260 +------------------------------------------------------------------------------+----------+
1260 +------------------------------------------------------------------------------+----------+
1261 | | | | | | | |
1261 | | | | | | | |
1262 | node | p1 node | p2 node | base node | link node | flags | pflags |
1262 | node | p1 node | p2 node | base node | link node | flags | pflags |
1263 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) |
1263 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) |
1264 | | | | | | | |
1264 | | | | | | | |
1265 +------------------------------------------------------------------------------+----------+
1265 +------------------------------------------------------------------------------+----------+
1266
1266
1267 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1267 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1268 contain a series of *delta*s, densely packed (no separators). These deltas
1268 contain a series of *delta*s, densely packed (no separators). These deltas
1269 describe a diff from an existing entry (either that the recipient already
1269 describe a diff from an existing entry (either that the recipient already
1270 has, or previously specified in the bundle/changegroup). The format is
1270 has, or previously specified in the bundle/changegroup). The format is
1271 described more fully in "hg help internals.bdiff", but briefly:
1271 described more fully in "hg help internals.bdiff", but briefly:
1272
1272
1273 +---------------------------------------------------------------+
1273 +---------------------------------------------------------------+
1274 | | | | |
1274 | | | | |
1275 | start offset | end offset | new length | content |
1275 | start offset | end offset | new length | content |
1276 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1276 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1277 | | | | |
1277 | | | | |
1278 +---------------------------------------------------------------+
1278 +---------------------------------------------------------------+
1279
1279
1280 Please note that the length field in the delta data does *not* include
1280 Please note that the length field in the delta data does *not* include
1281 itself.
1281 itself.
1282
1282
1283 In version 1, the delta is always applied against the previous node from
1283 In version 1, the delta is always applied against the previous node from
1284 the changegroup or the first parent if this is the first entry in the
1284 the changegroup or the first parent if this is the first entry in the
1285 changegroup.
1285 changegroup.
1286
1286
1287 In version 2 and up, the delta base node is encoded in the entry in the
1287 In version 2 and up, the delta base node is encoded in the entry in the
1288 changegroup. This allows the delta to be expressed against any parent,
1288 changegroup. This allows the delta to be expressed against any parent,
1289 which can result in smaller deltas and more efficient encoding of data.
1289 which can result in smaller deltas and more efficient encoding of data.
1290
1290
1291 The *flags* field holds bitwise flags affecting the processing of revision
1291 The *flags* field holds bitwise flags affecting the processing of revision
1292 data. The following flags are defined:
1292 data. The following flags are defined:
1293
1293
1294 32768
1294 32768
1295 Censored revision. The revision's fulltext has been replaced by censor
1295 Censored revision. The revision's fulltext has been replaced by censor
1296 metadata. May only occur on file revisions.
1296 metadata. May only occur on file revisions.
1297
1297
1298 16384
1298 16384
1299 Ellipsis revision. Revision hash does not match data (likely due to
1299 Ellipsis revision. Revision hash does not match data (likely due to
1300 rewritten parents).
1300 rewritten parents).
1301
1301
1302 8192
1302 8192
1303 Externally stored. The revision fulltext contains "key:value" "\n"
1303 Externally stored. The revision fulltext contains "key:value" "\n"
1304 delimited metadata defining an object stored elsewhere. Used by the LFS
1304 delimited metadata defining an object stored elsewhere. Used by the LFS
1305 extension.
1305 extension.
1306
1306
1307 4096
1307 4096
1308 Contains copy information. This revision changes files in a way that
1308 Contains copy information. This revision changes files in a way that
1309 could affect copy tracing. This does *not* affect changegroup handling,
1309 could affect copy tracing. This does *not* affect changegroup handling,
1310 but is relevant for other parts of Mercurial.
1310 but is relevant for other parts of Mercurial.
1311
1311
1312 For historical reasons, the integer values are identical to revlog version
1312 For historical reasons, the integer values are identical to revlog version
1313 1 per-revision storage flags and correspond to bits being set in this
1313 1 per-revision storage flags and correspond to bits being set in this
1314 2-byte field. Bits were allocated starting from the most-significant bit,
1314 2-byte field. Bits were allocated starting from the most-significant bit,
1315 hence the reverse ordering and allocation of these flags.
1315 hence the reverse ordering and allocation of these flags.
1316
1316
1317 The *pflags* (protocol flags) field holds bitwise flags affecting the
1317 The *pflags* (protocol flags) field holds bitwise flags affecting the
1318 protocol itself. They are first in the header since they may affect the
1318 protocol itself. They are first in the header since they may affect the
1319 handling of the rest of the fields in a future version. They are defined
1319 handling of the rest of the fields in a future version. They are defined
1320 as such:
1320 as such:
1321
1321
1322 1 indicates whether to read a chunk of sidedata (of variable length) right
1322 1 indicates whether to read a chunk of sidedata (of variable length) right
1323 after the revision flags.
1323 after the revision flags.
1324
1324
1325 Changeset Segment
1325 Changeset Segment
1326 =================
1326 =================
1327
1327
1328 The *changeset segment* consists of a single *delta group* holding
1328 The *changeset segment* consists of a single *delta group* holding
1329 changelog data. The *empty chunk* at the end of the *delta group* denotes
1329 changelog data. The *empty chunk* at the end of the *delta group* denotes
1330 the boundary to the *manifest segment*.
1330 the boundary to the *manifest segment*.
1331
1331
1332 Manifest Segment
1332 Manifest Segment
1333 ================
1333 ================
1334
1334
1335 The *manifest segment* consists of a single *delta group* holding manifest
1335 The *manifest segment* consists of a single *delta group* holding manifest
1336 data. If treemanifests are in use, it contains only the manifest for the
1336 data. If treemanifests are in use, it contains only the manifest for the
1337 root directory of the repository. Otherwise, it contains the entire
1337 root directory of the repository. Otherwise, it contains the entire
1338 manifest data. The *empty chunk* at the end of the *delta group* denotes
1338 manifest data. The *empty chunk* at the end of the *delta group* denotes
1339 the boundary to the next segment (either the *treemanifests segment* or
1339 the boundary to the next segment (either the *treemanifests segment* or
1340 the *filelogs segment*, depending on version and the request options).
1340 the *filelogs segment*, depending on version and the request options).
1341
1341
1342 Treemanifests Segment
1342 Treemanifests Segment
1343 ---------------------
1343 ---------------------
1344
1344
1345 The *treemanifests segment* only exists in changegroup version "3" and
1345 The *treemanifests segment* only exists in changegroup version "3" and
1346 "4", and only if the 'treemanifest' param is part of the bundle2
1346 "4", and only if the 'treemanifest' param is part of the bundle2
1347 changegroup part (it is not possible to use changegroup version 3 or 4
1347 changegroup part (it is not possible to use changegroup version 3 or 4
1348 outside of bundle2). Aside from the filenames in the *treemanifests
1348 outside of bundle2). Aside from the filenames in the *treemanifests
1349 segment* containing a trailing "/" character, it behaves identically to
1349 segment* containing a trailing "/" character, it behaves identically to
1350 the *filelogs segment* (see below). The final sub-segment is followed by
1350 the *filelogs segment* (see below). The final sub-segment is followed by
1351 an *empty chunk* (logically, a sub-segment with filename size 0). This
1351 an *empty chunk* (logically, a sub-segment with filename size 0). This
1352 denotes the boundary to the *filelogs segment*.
1352 denotes the boundary to the *filelogs segment*.
1353
1353
1354 Filelogs Segment
1354 Filelogs Segment
1355 ================
1355 ================
1356
1356
1357 The *filelogs segment* consists of multiple sub-segments, each
1357 The *filelogs segment* consists of multiple sub-segments, each
1358 corresponding to an individual file whose data is being described:
1358 corresponding to an individual file whose data is being described:
1359
1359
1360 +--------------------------------------------------+
1360 +--------------------------------------------------+
1361 | | | | | |
1361 | | | | | |
1362 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1362 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1363 | | | | | (4 bytes) |
1363 | | | | | (4 bytes) |
1364 | | | | | |
1364 | | | | | |
1365 +--------------------------------------------------+
1365 +--------------------------------------------------+
1366
1366
1367 The final filelog sub-segment is followed by an *empty chunk* (logically,
1367 The final filelog sub-segment is followed by an *empty chunk* (logically,
1368 a sub-segment with filename size 0). This denotes the end of the segment
1368 a sub-segment with filename size 0). This denotes the end of the segment
1369 and of the overall changegroup.
1369 and of the overall changegroup.
1370
1370
1371 Each filelog sub-segment consists of the following:
1371 Each filelog sub-segment consists of the following:
1372
1372
1373 +------------------------------------------------------+
1373 +------------------------------------------------------+
1374 | | | |
1374 | | | |
1375 | filename length | filename | delta group |
1375 | filename length | filename | delta group |
1376 | (4 bytes) | (<length - 4> bytes) | (various) |
1376 | (4 bytes) | (<length - 4> bytes) | (various) |
1377 | | | |
1377 | | | |
1378 +------------------------------------------------------+
1378 +------------------------------------------------------+
1379
1379
1380 That is, a *chunk* consisting of the filename (not terminated or padded)
1380 That is, a *chunk* consisting of the filename (not terminated or padded)
1381 followed by N chunks constituting the *delta group* for this file. The
1381 followed by N chunks constituting the *delta group* for this file. The
1382 *empty chunk* at the end of each *delta group* denotes the boundary to the
1382 *empty chunk* at the end of each *delta group* denotes the boundary to the
1383 next filelog sub-segment.
1383 next filelog sub-segment.
1384
1384
1385 non-existent subtopics print an error
1385 non-existent subtopics print an error
1386
1386
1387 $ hg help internals.foo
1387 $ hg help internals.foo
1388 abort: no such help topic: internals.foo
1388 abort: no such help topic: internals.foo
1389 (try 'hg help --keyword foo')
1389 (try 'hg help --keyword foo')
1390 [10]
1390 [10]
1391
1391
1392 test advanced, deprecated and experimental options are hidden in command help
1392 test advanced, deprecated and experimental options are hidden in command help
1393 $ hg help debugoptADV
1393 $ hg help debugoptADV
1394 hg debugoptADV
1394 hg debugoptADV
1395
1395
1396 (no help text available)
1396 (no help text available)
1397
1397
1398 options:
1398 options:
1399
1399
1400 (some details hidden, use --verbose to show complete help)
1400 (some details hidden, use --verbose to show complete help)
1401 $ hg help debugoptDEP
1401 $ hg help debugoptDEP
1402 hg debugoptDEP
1402 hg debugoptDEP
1403
1403
1404 (no help text available)
1404 (no help text available)
1405
1405
1406 options:
1406 options:
1407
1407
1408 (some details hidden, use --verbose to show complete help)
1408 (some details hidden, use --verbose to show complete help)
1409
1409
1410 $ hg help debugoptEXP
1410 $ hg help debugoptEXP
1411 hg debugoptEXP
1411 hg debugoptEXP
1412
1412
1413 (no help text available)
1413 (no help text available)
1414
1414
1415 options:
1415 options:
1416
1416
1417 (some details hidden, use --verbose to show complete help)
1417 (some details hidden, use --verbose to show complete help)
1418
1418
1419 test advanced, deprecated and experimental options are shown with -v
1419 test advanced, deprecated and experimental options are shown with -v
1420 $ hg help -v debugoptADV | grep aopt
1420 $ hg help -v debugoptADV | grep aopt
1421 --aopt option is (ADVANCED)
1421 --aopt option is (ADVANCED)
1422 $ hg help -v debugoptDEP | grep dopt
1422 $ hg help -v debugoptDEP | grep dopt
1423 --dopt option is (DEPRECATED)
1423 --dopt option is (DEPRECATED)
1424 $ hg help -v debugoptEXP | grep eopt
1424 $ hg help -v debugoptEXP | grep eopt
1425 --eopt option is (EXPERIMENTAL)
1425 --eopt option is (EXPERIMENTAL)
1426
1426
1427 #if gettext
1427 #if gettext
1428 test deprecated option is hidden with translation with untranslated description
1428 test deprecated option is hidden with translation with untranslated description
1429 (use many globy for not failing on changed transaction)
1429 (use many globy for not failing on changed transaction)
1430 $ LANGUAGE=sv hg help debugoptDEP
1430 $ LANGUAGE=sv hg help debugoptDEP
1431 hg debugoptDEP
1431 hg debugoptDEP
1432
1432
1433 (*) (glob)
1433 (*) (glob)
1434
1434
1435 options:
1435 options:
1436
1436
1437 (some details hidden, use --verbose to show complete help)
1437 (some details hidden, use --verbose to show complete help)
1438 #endif
1438 #endif
1439
1439
1440 Test commands that collide with topics (issue4240)
1440 Test commands that collide with topics (issue4240)
1441
1441
1442 $ hg config -hq
1442 $ hg config -hq
1443 hg config [-u] [NAME]...
1443 hg config [-u] [NAME]...
1444
1444
1445 show combined config settings from all hgrc files
1445 show combined config settings from all hgrc files
1446 $ hg showconfig -hq
1446 $ hg showconfig -hq
1447 hg config [-u] [NAME]...
1447 hg config [-u] [NAME]...
1448
1448
1449 show combined config settings from all hgrc files
1449 show combined config settings from all hgrc files
1450
1450
1451 Test a help topic
1451 Test a help topic
1452
1452
1453 $ hg help dates
1453 $ hg help dates
1454 Date Formats
1454 Date Formats
1455 """"""""""""
1455 """"""""""""
1456
1456
1457 Some commands allow the user to specify a date, e.g.:
1457 Some commands allow the user to specify a date, e.g.:
1458
1458
1459 - backout, commit, import, tag: Specify the commit date.
1459 - backout, commit, import, tag: Specify the commit date.
1460 - log, revert, update: Select revision(s) by date.
1460 - log, revert, update: Select revision(s) by date.
1461
1461
1462 Many date formats are valid. Here are some examples:
1462 Many date formats are valid. Here are some examples:
1463
1463
1464 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1464 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1465 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1465 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1466 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1466 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1467 - "Dec 6" (midnight)
1467 - "Dec 6" (midnight)
1468 - "13:18" (today assumed)
1468 - "13:18" (today assumed)
1469 - "3:39" (3:39AM assumed)
1469 - "3:39" (3:39AM assumed)
1470 - "3:39pm" (15:39)
1470 - "3:39pm" (15:39)
1471 - "2006-12-06 13:18:29" (ISO 8601 format)
1471 - "2006-12-06 13:18:29" (ISO 8601 format)
1472 - "2006-12-6 13:18"
1472 - "2006-12-6 13:18"
1473 - "2006-12-6"
1473 - "2006-12-6"
1474 - "12-6"
1474 - "12-6"
1475 - "12/6"
1475 - "12/6"
1476 - "12/6/6" (Dec 6 2006)
1476 - "12/6/6" (Dec 6 2006)
1477 - "today" (midnight)
1477 - "today" (midnight)
1478 - "yesterday" (midnight)
1478 - "yesterday" (midnight)
1479 - "now" - right now
1479 - "now" - right now
1480
1480
1481 Lastly, there is Mercurial's internal format:
1481 Lastly, there is Mercurial's internal format:
1482
1482
1483 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1483 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1484
1484
1485 This is the internal representation format for dates. The first number is
1485 This is the internal representation format for dates. The first number is
1486 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1486 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1487 is the offset of the local timezone, in seconds west of UTC (negative if
1487 is the offset of the local timezone, in seconds west of UTC (negative if
1488 the timezone is east of UTC).
1488 the timezone is east of UTC).
1489
1489
1490 The log command also accepts date ranges:
1490 The log command also accepts date ranges:
1491
1491
1492 - "<DATE" - at or before a given date/time
1492 - "<DATE" - at or before a given date/time
1493 - ">DATE" - on or after a given date/time
1493 - ">DATE" - on or after a given date/time
1494 - "DATE to DATE" - a date range, inclusive
1494 - "DATE to DATE" - a date range, inclusive
1495 - "-DAYS" - within a given number of days from today
1495 - "-DAYS" - within a given number of days from today
1496
1496
1497 Test repeated config section name
1497 Test repeated config section name
1498
1498
1499 $ hg help config.host
1499 $ hg help config.host
1500 "http_proxy.host"
1500 "http_proxy.host"
1501 Host name and (optional) port of the proxy server, for example
1501 Host name and (optional) port of the proxy server, for example
1502 "myproxy:8000".
1502 "myproxy:8000".
1503
1503
1504 "smtp.host"
1504 "smtp.host"
1505 Host name of mail server, e.g. "mail.example.com".
1505 Host name of mail server, e.g. "mail.example.com".
1506
1506
1507
1507
1508 Test section name with dot
1508 Test section name with dot
1509
1509
1510 $ hg help config.ui.username
1510 $ hg help config.ui.username
1511 "ui.username"
1511 "ui.username"
1512 The committer of a changeset created when running "commit". Typically
1512 The committer of a changeset created when running "commit". Typically
1513 a person's name and email address, e.g. "Fred Widget
1513 a person's name and email address, e.g. "Fred Widget
1514 <fred@example.com>". Environment variables in the username are
1514 <fred@example.com>". Environment variables in the username are
1515 expanded.
1515 expanded.
1516
1516
1517 (default: "$EMAIL" or "username@hostname". If the username in hgrc is
1517 (default: "$EMAIL" or "username@hostname". If the username in hgrc is
1518 empty, e.g. if the system admin set "username =" in the system hgrc,
1518 empty, e.g. if the system admin set "username =" in the system hgrc,
1519 it has to be specified manually or in a different hgrc file)
1519 it has to be specified manually or in a different hgrc file)
1520
1520
1521
1521
1522 $ hg help config.annotate.git
1522 $ hg help config.annotate.git
1523 abort: help section not found: config.annotate.git
1523 abort: help section not found: config.annotate.git
1524 [10]
1524 [10]
1525
1525
1526 $ hg help config.update.check
1526 $ hg help config.update.check
1527 "commands.update.check"
1527 "commands.update.check"
1528 Determines what level of checking 'hg update' will perform before
1528 Determines what level of checking 'hg update' will perform before
1529 moving to a destination revision. Valid values are "abort", "none",
1529 moving to a destination revision. Valid values are "abort", "none",
1530 "linear", and "noconflict".
1530 "linear", and "noconflict".
1531
1531
1532 - "abort" always fails if the working directory has uncommitted
1532 - "abort" always fails if the working directory has uncommitted
1533 changes.
1533 changes.
1534 - "none" performs no checking, and may result in a merge with
1534 - "none" performs no checking, and may result in a merge with
1535 uncommitted changes.
1535 uncommitted changes.
1536 - "linear" allows any update as long as it follows a straight line in
1536 - "linear" allows any update as long as it follows a straight line in
1537 the revision history, and may trigger a merge with uncommitted
1537 the revision history, and may trigger a merge with uncommitted
1538 changes.
1538 changes.
1539 - "noconflict" will allow any update which would not trigger a merge
1539 - "noconflict" will allow any update which would not trigger a merge
1540 with uncommitted changes, if any are present.
1540 with uncommitted changes, if any are present.
1541
1541
1542 (default: "linear")
1542 (default: "linear")
1543
1543
1544
1544
1545 $ hg help config.commands.update.check
1545 $ hg help config.commands.update.check
1546 "commands.update.check"
1546 "commands.update.check"
1547 Determines what level of checking 'hg update' will perform before
1547 Determines what level of checking 'hg update' will perform before
1548 moving to a destination revision. Valid values are "abort", "none",
1548 moving to a destination revision. Valid values are "abort", "none",
1549 "linear", and "noconflict".
1549 "linear", and "noconflict".
1550
1550
1551 - "abort" always fails if the working directory has uncommitted
1551 - "abort" always fails if the working directory has uncommitted
1552 changes.
1552 changes.
1553 - "none" performs no checking, and may result in a merge with
1553 - "none" performs no checking, and may result in a merge with
1554 uncommitted changes.
1554 uncommitted changes.
1555 - "linear" allows any update as long as it follows a straight line in
1555 - "linear" allows any update as long as it follows a straight line in
1556 the revision history, and may trigger a merge with uncommitted
1556 the revision history, and may trigger a merge with uncommitted
1557 changes.
1557 changes.
1558 - "noconflict" will allow any update which would not trigger a merge
1558 - "noconflict" will allow any update which would not trigger a merge
1559 with uncommitted changes, if any are present.
1559 with uncommitted changes, if any are present.
1560
1560
1561 (default: "linear")
1561 (default: "linear")
1562
1562
1563
1563
1564 $ hg help config.ommands.update.check
1564 $ hg help config.ommands.update.check
1565 abort: help section not found: config.ommands.update.check
1565 abort: help section not found: config.ommands.update.check
1566 [10]
1566 [10]
1567
1567
1568 Unrelated trailing paragraphs shouldn't be included
1568 Unrelated trailing paragraphs shouldn't be included
1569
1569
1570 $ hg help config.extramsg | grep '^$'
1570 $ hg help config.extramsg | grep '^$'
1571
1571
1572
1572
1573 Test capitalized section name
1573 Test capitalized section name
1574
1574
1575 $ hg help scripting.HGPLAIN > /dev/null
1575 $ hg help scripting.HGPLAIN > /dev/null
1576
1576
1577 Help subsection:
1577 Help subsection:
1578
1578
1579 $ hg help config.charsets |grep "Email example:" > /dev/null
1579 $ hg help config.charsets |grep "Email example:" > /dev/null
1580 [1]
1580 [1]
1581
1581
1582 Show nested definitions
1582 Show nested definitions
1583 ("profiling.type"[break]"ls"[break]"stat"[break])
1583 ("profiling.type"[break]"ls"[break]"stat"[break])
1584
1584
1585 $ hg help config.type | egrep '^$'|wc -l
1585 $ hg help config.type | egrep '^$'|wc -l
1586 \s*3 (re)
1586 \s*3 (re)
1587
1587
1588 $ hg help config.profiling.type.ls
1588 $ hg help config.profiling.type.ls
1589 "profiling.type.ls"
1589 "profiling.type.ls"
1590 Use Python's built-in instrumenting profiler. This profiler works on
1590 Use Python's built-in instrumenting profiler. This profiler works on
1591 all platforms, but each line number it reports is the first line of
1591 all platforms, but each line number it reports is the first line of
1592 a function. This restriction makes it difficult to identify the
1592 a function. This restriction makes it difficult to identify the
1593 expensive parts of a non-trivial function.
1593 expensive parts of a non-trivial function.
1594
1594
1595
1595
1596 Separate sections from subsections
1596 Separate sections from subsections
1597
1597
1598 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1598 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1599 "format"
1599 "format"
1600 --------
1600 --------
1601
1601
1602 "usegeneraldelta"
1602 "usegeneraldelta"
1603
1603
1604 "dotencode"
1604 "dotencode"
1605
1605
1606 "usefncache"
1606 "usefncache"
1607
1607
1608 "use-dirstate-v2"
1608 "use-dirstate-v2"
1609
1609
1610 "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories"
1610 "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories"
1611
1611
1612 "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet"
1612 "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet"
1613
1613
1614 "use-dirstate-tracked-hint"
1614 "use-dirstate-tracked-hint"
1615
1615
1616 "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories"
1616 "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories"
1617
1617
1618 "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet"
1618 "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet"
1619
1619
1620 "use-persistent-nodemap"
1620 "use-persistent-nodemap"
1621
1621
1622 "use-share-safe"
1622 "use-share-safe"
1623
1623
1624 "use-share-safe.automatic-upgrade-of-mismatching-repositories"
1624 "use-share-safe.automatic-upgrade-of-mismatching-repositories"
1625
1625
1626 "use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet"
1626 "use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet"
1627
1627
1628 "usestore"
1628 "usestore"
1629
1629
1630 "sparse-revlog"
1630 "sparse-revlog"
1631
1631
1632 "revlog-compression"
1632 "revlog-compression"
1633
1633
1634 "bookmarks-in-store"
1634 "bookmarks-in-store"
1635
1635
1636 "profiling"
1636 "profiling"
1637 -----------
1637 -----------
1638
1638
1639 "format"
1639 "format"
1640
1640
1641 "progress"
1641 "progress"
1642 ----------
1642 ----------
1643
1643
1644 "format"
1644 "format"
1645
1645
1646
1646
1647 Last item in help config.*:
1647 Last item in help config.*:
1648
1648
1649 $ hg help config.`hg help config|grep '^ "'| \
1649 $ hg help config.`hg help config|grep '^ "'| \
1650 > tail -1|sed 's![ "]*!!g'`| \
1650 > tail -1|sed 's![ "]*!!g'`| \
1651 > grep 'hg help -c config' > /dev/null
1651 > grep 'hg help -c config' > /dev/null
1652 [1]
1652 [1]
1653
1653
1654 note to use help -c for general hg help config:
1654 note to use help -c for general hg help config:
1655
1655
1656 $ hg help config |grep 'hg help -c config' > /dev/null
1656 $ hg help config |grep 'hg help -c config' > /dev/null
1657
1657
1658 Test templating help
1658 Test templating help
1659
1659
1660 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1660 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1661 desc String. The text of the changeset description.
1661 desc String. The text of the changeset description.
1662 diffstat String. Statistics of changes with the following format:
1662 diffstat String. Statistics of changes with the following format:
1663 firstline Any text. Returns the first line of text.
1663 firstline Any text. Returns the first line of text.
1664 nonempty Any text. Returns '(none)' if the string is empty.
1664 nonempty Any text. Returns '(none)' if the string is empty.
1665
1665
1666 Test deprecated items
1666 Test deprecated items
1667
1667
1668 $ hg help -v templating | grep currentbookmark
1668 $ hg help -v templating | grep currentbookmark
1669 currentbookmark
1669 currentbookmark
1670 $ hg help templating | (grep currentbookmark || true)
1670 $ hg help templating | (grep currentbookmark || true)
1671
1671
1672 Test help hooks
1672 Test help hooks
1673
1673
1674 $ cat > helphook1.py <<EOF
1674 $ cat > helphook1.py <<EOF
1675 > from mercurial import help
1675 > from mercurial import help
1676 >
1676 >
1677 > def rewrite(ui, topic, doc):
1677 > def rewrite(ui, topic, doc):
1678 > return doc + b'\nhelphook1\n'
1678 > return doc + b'\nhelphook1\n'
1679 >
1679 >
1680 > def extsetup(ui):
1680 > def extsetup(ui):
1681 > help.addtopichook(b'revisions', rewrite)
1681 > help.addtopichook(b'revisions', rewrite)
1682 > EOF
1682 > EOF
1683 $ cat > helphook2.py <<EOF
1683 $ cat > helphook2.py <<EOF
1684 > from mercurial import help
1684 > from mercurial import help
1685 >
1685 >
1686 > def rewrite(ui, topic, doc):
1686 > def rewrite(ui, topic, doc):
1687 > return doc + b'\nhelphook2\n'
1687 > return doc + b'\nhelphook2\n'
1688 >
1688 >
1689 > def extsetup(ui):
1689 > def extsetup(ui):
1690 > help.addtopichook(b'revisions', rewrite)
1690 > help.addtopichook(b'revisions', rewrite)
1691 > EOF
1691 > EOF
1692 $ echo '[extensions]' >> $HGRCPATH
1692 $ echo '[extensions]' >> $HGRCPATH
1693 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1693 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1694 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1694 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1695 $ hg help revsets | grep helphook
1695 $ hg help revsets | grep helphook
1696 helphook1
1696 helphook1
1697 helphook2
1697 helphook2
1698
1698
1699 help -c should only show debug --debug
1699 help -c should only show debug --debug
1700
1700
1701 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1701 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1702 [1]
1702 [1]
1703
1703
1704 help -c should only show deprecated for -v
1704 help -c should only show deprecated for -v
1705
1705
1706 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1706 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1707 [1]
1707 [1]
1708
1708
1709 Test -s / --system
1709 Test -s / --system
1710
1710
1711 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1711 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1712 > wc -l | sed -e 's/ //g'
1712 > wc -l | sed -e 's/ //g'
1713 0
1713 0
1714 $ hg help config.files --system unix | grep 'USER' | \
1714 $ hg help config.files --system unix | grep 'USER' | \
1715 > wc -l | sed -e 's/ //g'
1715 > wc -l | sed -e 's/ //g'
1716 0
1716 0
1717
1717
1718 Test -e / -c / -k combinations
1718 Test -e / -c / -k combinations
1719
1719
1720 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1720 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1721 Commands:
1721 Commands:
1722 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1722 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1723 Extensions:
1723 Extensions:
1724 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1724 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1725 Topics:
1725 Topics:
1726 Commands:
1726 Commands:
1727 Extensions:
1727 Extensions:
1728 Extension Commands:
1728 Extension Commands:
1729 $ hg help -c schemes
1729 $ hg help -c schemes
1730 abort: no such help topic: schemes
1730 abort: no such help topic: schemes
1731 (try 'hg help --keyword schemes')
1731 (try 'hg help --keyword schemes')
1732 [10]
1732 [10]
1733 $ hg help -e schemes |head -1
1733 $ hg help -e schemes |head -1
1734 schemes extension - extend schemes with shortcuts to repository swarms
1734 schemes extension - extend schemes with shortcuts to repository swarms
1735 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1735 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1736 Commands:
1736 Commands:
1737 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1737 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1738 Extensions:
1738 Extensions:
1739 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1739 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1740 Extensions:
1740 Extensions:
1741 Commands:
1741 Commands:
1742 $ hg help -c commit > /dev/null
1742 $ hg help -c commit > /dev/null
1743 $ hg help -e -c commit > /dev/null
1743 $ hg help -e -c commit > /dev/null
1744 $ hg help -e commit
1744 $ hg help -e commit
1745 abort: no such help topic: commit
1745 abort: no such help topic: commit
1746 (try 'hg help --keyword commit')
1746 (try 'hg help --keyword commit')
1747 [10]
1747 [10]
1748
1748
1749 Test keyword search help
1749 Test keyword search help
1750
1750
1751 $ cat > prefixedname.py <<EOF
1751 $ cat > prefixedname.py <<EOF
1752 > '''matched against word "clone"
1752 > '''matched against word "clone"
1753 > '''
1753 > '''
1754 > EOF
1754 > EOF
1755 $ echo '[extensions]' >> $HGRCPATH
1755 $ echo '[extensions]' >> $HGRCPATH
1756 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1756 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1757 $ hg help -k clone
1757 $ hg help -k clone
1758 Topics:
1758 Topics:
1759
1759
1760 config Configuration Files
1760 config Configuration Files
1761 extensions Using Additional Features
1761 extensions Using Additional Features
1762 glossary Glossary
1762 glossary Glossary
1763 phases Working with Phases
1763 phases Working with Phases
1764 subrepos Subrepositories
1764 subrepos Subrepositories
1765 urls URL Paths
1765 urls URL Paths
1766
1766
1767 Commands:
1767 Commands:
1768
1768
1769 bookmarks create a new bookmark or list existing bookmarks
1769 bookmarks create a new bookmark or list existing bookmarks
1770 clone make a copy of an existing repository
1770 clone make a copy of an existing repository
1771 paths show aliases for remote repositories
1771 paths show aliases for remote repositories
1772 pull pull changes from the specified source
1772 pull pull changes from the specified source
1773 update update working directory (or switch revisions)
1773 update update working directory (or switch revisions)
1774
1774
1775 Extensions:
1775 Extensions:
1776
1776
1777 clonebundles advertise pre-generated bundles to seed clones
1777 clonebundles advertise pre-generated bundles to seed clones
1778 narrow create clones which fetch history data for subset of files
1778 narrow create clones which fetch history data for subset of files
1779 (EXPERIMENTAL)
1779 (EXPERIMENTAL)
1780 prefixedname matched against word "clone"
1780 prefixedname matched against word "clone"
1781 relink recreates hardlinks between repository clones
1781 relink recreates hardlinks between repository clones
1782
1782
1783 Extension Commands:
1783 Extension Commands:
1784
1784
1785 admin::clone-bundles-clear remove existing clone bundle caches
1785 admin::clone-bundles-refresh generate clone bundles according to the
1786 admin::clone-bundles-refresh generate clone bundles according to the
1786 configuration
1787 configuration
1787 qclone clone main and patch repository at same time
1788 qclone clone main and patch repository at same time
1788
1789
1789 Test unfound topic
1790 Test unfound topic
1790
1791
1791 $ hg help nonexistingtopicthatwillneverexisteverever
1792 $ hg help nonexistingtopicthatwillneverexisteverever
1792 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1793 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1793 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1794 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1794 [10]
1795 [10]
1795
1796
1796 Test unfound keyword
1797 Test unfound keyword
1797
1798
1798 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1799 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1799 abort: no matches
1800 abort: no matches
1800 (try 'hg help' for a list of topics)
1801 (try 'hg help' for a list of topics)
1801 [10]
1802 [10]
1802
1803
1803 Test omit indicating for help
1804 Test omit indicating for help
1804
1805
1805 $ cat > addverboseitems.py <<EOF
1806 $ cat > addverboseitems.py <<EOF
1806 > r'''extension to test omit indicating.
1807 > r'''extension to test omit indicating.
1807 >
1808 >
1808 > This paragraph is never omitted (for extension)
1809 > This paragraph is never omitted (for extension)
1809 >
1810 >
1810 > .. container:: verbose
1811 > .. container:: verbose
1811 >
1812 >
1812 > This paragraph is omitted,
1813 > This paragraph is omitted,
1813 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1814 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1814 >
1815 >
1815 > This paragraph is never omitted, too (for extension)
1816 > This paragraph is never omitted, too (for extension)
1816 > '''
1817 > '''
1817 > from mercurial import commands, help
1818 > from mercurial import commands, help
1818 > testtopic = br"""This paragraph is never omitted (for topic).
1819 > testtopic = br"""This paragraph is never omitted (for topic).
1819 >
1820 >
1820 > .. container:: verbose
1821 > .. container:: verbose
1821 >
1822 >
1822 > This paragraph is omitted,
1823 > This paragraph is omitted,
1823 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1824 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1824 >
1825 >
1825 > This paragraph is never omitted, too (for topic)
1826 > This paragraph is never omitted, too (for topic)
1826 > """
1827 > """
1827 > def extsetup(ui):
1828 > def extsetup(ui):
1828 > help.helptable.append(([b"topic-containing-verbose"],
1829 > help.helptable.append(([b"topic-containing-verbose"],
1829 > b"This is the topic to test omit indicating.",
1830 > b"This is the topic to test omit indicating.",
1830 > lambda ui: testtopic))
1831 > lambda ui: testtopic))
1831 > EOF
1832 > EOF
1832 $ echo '[extensions]' >> $HGRCPATH
1833 $ echo '[extensions]' >> $HGRCPATH
1833 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1834 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1834 $ hg help addverboseitems
1835 $ hg help addverboseitems
1835 addverboseitems extension - extension to test omit indicating.
1836 addverboseitems extension - extension to test omit indicating.
1836
1837
1837 This paragraph is never omitted (for extension)
1838 This paragraph is never omitted (for extension)
1838
1839
1839 This paragraph is never omitted, too (for extension)
1840 This paragraph is never omitted, too (for extension)
1840
1841
1841 (some details hidden, use --verbose to show complete help)
1842 (some details hidden, use --verbose to show complete help)
1842
1843
1843 no commands defined
1844 no commands defined
1844 $ hg help -v addverboseitems
1845 $ hg help -v addverboseitems
1845 addverboseitems extension - extension to test omit indicating.
1846 addverboseitems extension - extension to test omit indicating.
1846
1847
1847 This paragraph is never omitted (for extension)
1848 This paragraph is never omitted (for extension)
1848
1849
1849 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1850 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1850 extension)
1851 extension)
1851
1852
1852 This paragraph is never omitted, too (for extension)
1853 This paragraph is never omitted, too (for extension)
1853
1854
1854 no commands defined
1855 no commands defined
1855 $ hg help topic-containing-verbose
1856 $ hg help topic-containing-verbose
1856 This is the topic to test omit indicating.
1857 This is the topic to test omit indicating.
1857 """"""""""""""""""""""""""""""""""""""""""
1858 """"""""""""""""""""""""""""""""""""""""""
1858
1859
1859 This paragraph is never omitted (for topic).
1860 This paragraph is never omitted (for topic).
1860
1861
1861 This paragraph is never omitted, too (for topic)
1862 This paragraph is never omitted, too (for topic)
1862
1863
1863 (some details hidden, use --verbose to show complete help)
1864 (some details hidden, use --verbose to show complete help)
1864 $ hg help -v topic-containing-verbose
1865 $ hg help -v topic-containing-verbose
1865 This is the topic to test omit indicating.
1866 This is the topic to test omit indicating.
1866 """"""""""""""""""""""""""""""""""""""""""
1867 """"""""""""""""""""""""""""""""""""""""""
1867
1868
1868 This paragraph is never omitted (for topic).
1869 This paragraph is never omitted (for topic).
1869
1870
1870 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1871 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1871 topic)
1872 topic)
1872
1873
1873 This paragraph is never omitted, too (for topic)
1874 This paragraph is never omitted, too (for topic)
1874
1875
1875 Test section lookup
1876 Test section lookup
1876
1877
1877 $ hg help revset.merge
1878 $ hg help revset.merge
1878 "merge()"
1879 "merge()"
1879 Changeset is a merge changeset.
1880 Changeset is a merge changeset.
1880
1881
1881 $ hg help glossary.dag
1882 $ hg help glossary.dag
1882 DAG
1883 DAG
1883 The repository of changesets of a distributed version control system
1884 The repository of changesets of a distributed version control system
1884 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1885 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1885 of nodes and edges, where nodes correspond to changesets and edges
1886 of nodes and edges, where nodes correspond to changesets and edges
1886 imply a parent -> child relation. This graph can be visualized by
1887 imply a parent -> child relation. This graph can be visualized by
1887 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1888 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1888 limited by the requirement for children to have at most two parents.
1889 limited by the requirement for children to have at most two parents.
1889
1890
1890
1891
1891 $ hg help hgrc.paths
1892 $ hg help hgrc.paths
1892 "paths"
1893 "paths"
1893 -------
1894 -------
1894
1895
1895 Assigns symbolic names and behavior to repositories.
1896 Assigns symbolic names and behavior to repositories.
1896
1897
1897 Options are symbolic names defining the URL or directory that is the
1898 Options are symbolic names defining the URL or directory that is the
1898 location of the repository. Example:
1899 location of the repository. Example:
1899
1900
1900 [paths]
1901 [paths]
1901 my_server = https://example.com/my_repo
1902 my_server = https://example.com/my_repo
1902 local_path = /home/me/repo
1903 local_path = /home/me/repo
1903
1904
1904 These symbolic names can be used from the command line. To pull from
1905 These symbolic names can be used from the command line. To pull from
1905 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1906 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1906 local_path'. You can check 'hg help urls' for details about valid URLs.
1907 local_path'. You can check 'hg help urls' for details about valid URLs.
1907
1908
1908 Options containing colons (":") denote sub-options that can influence
1909 Options containing colons (":") denote sub-options that can influence
1909 behavior for that specific path. Example:
1910 behavior for that specific path. Example:
1910
1911
1911 [paths]
1912 [paths]
1912 my_server = https://example.com/my_path
1913 my_server = https://example.com/my_path
1913 my_server:pushurl = ssh://example.com/my_path
1914 my_server:pushurl = ssh://example.com/my_path
1914
1915
1915 Paths using the 'path://otherpath' scheme will inherit the sub-options
1916 Paths using the 'path://otherpath' scheme will inherit the sub-options
1916 value from the path they point to.
1917 value from the path they point to.
1917
1918
1918 The following sub-options can be defined:
1919 The following sub-options can be defined:
1919
1920
1920 "multi-urls"
1921 "multi-urls"
1921 A boolean option. When enabled the value of the '[paths]' entry will be
1922 A boolean option. When enabled the value of the '[paths]' entry will be
1922 parsed as a list and the alias will resolve to multiple destination. If
1923 parsed as a list and the alias will resolve to multiple destination. If
1923 some of the list entry use the 'path://' syntax, the suboption will be
1924 some of the list entry use the 'path://' syntax, the suboption will be
1924 inherited individually.
1925 inherited individually.
1925
1926
1926 "pushurl"
1927 "pushurl"
1927 The URL to use for push operations. If not defined, the location
1928 The URL to use for push operations. If not defined, the location
1928 defined by the path's main entry is used.
1929 defined by the path's main entry is used.
1929
1930
1930 "pushrev"
1931 "pushrev"
1931 A revset defining which revisions to push by default.
1932 A revset defining which revisions to push by default.
1932
1933
1933 When 'hg push' is executed without a "-r" argument, the revset defined
1934 When 'hg push' is executed without a "-r" argument, the revset defined
1934 by this sub-option is evaluated to determine what to push.
1935 by this sub-option is evaluated to determine what to push.
1935
1936
1936 For example, a value of "." will push the working directory's revision
1937 For example, a value of "." will push the working directory's revision
1937 by default.
1938 by default.
1938
1939
1939 Revsets specifying bookmarks will not result in the bookmark being
1940 Revsets specifying bookmarks will not result in the bookmark being
1940 pushed.
1941 pushed.
1941
1942
1942 "bookmarks.mode"
1943 "bookmarks.mode"
1943 How bookmark will be dealt during the exchange. It support the following
1944 How bookmark will be dealt during the exchange. It support the following
1944 value
1945 value
1945
1946
1946 - "default": the default behavior, local and remote bookmarks are
1947 - "default": the default behavior, local and remote bookmarks are
1947 "merged" on push/pull.
1948 "merged" on push/pull.
1948 - "mirror": when pulling, replace local bookmarks by remote bookmarks.
1949 - "mirror": when pulling, replace local bookmarks by remote bookmarks.
1949 This is useful to replicate a repository, or as an optimization.
1950 This is useful to replicate a repository, or as an optimization.
1950 - "ignore": ignore bookmarks during exchange. (This currently only
1951 - "ignore": ignore bookmarks during exchange. (This currently only
1951 affect pulling)
1952 affect pulling)
1952
1953
1953 The following special named paths exist:
1954 The following special named paths exist:
1954
1955
1955 "default"
1956 "default"
1956 The URL or directory to use when no source or remote is specified.
1957 The URL or directory to use when no source or remote is specified.
1957
1958
1958 'hg clone' will automatically define this path to the location the
1959 'hg clone' will automatically define this path to the location the
1959 repository was cloned from.
1960 repository was cloned from.
1960
1961
1961 "default-push"
1962 "default-push"
1962 (deprecated) The URL or directory for the default 'hg push' location.
1963 (deprecated) The URL or directory for the default 'hg push' location.
1963 "default:pushurl" should be used instead.
1964 "default:pushurl" should be used instead.
1964
1965
1965 $ hg help glossary.mcguffin
1966 $ hg help glossary.mcguffin
1966 abort: help section not found: glossary.mcguffin
1967 abort: help section not found: glossary.mcguffin
1967 [10]
1968 [10]
1968
1969
1969 $ hg help glossary.mc.guffin
1970 $ hg help glossary.mc.guffin
1970 abort: help section not found: glossary.mc.guffin
1971 abort: help section not found: glossary.mc.guffin
1971 [10]
1972 [10]
1972
1973
1973 $ hg help template.files
1974 $ hg help template.files
1974 files List of strings. All files modified, added, or removed by
1975 files List of strings. All files modified, added, or removed by
1975 this changeset.
1976 this changeset.
1976 files(pattern)
1977 files(pattern)
1977 All files of the current changeset matching the pattern. See
1978 All files of the current changeset matching the pattern. See
1978 'hg help patterns'.
1979 'hg help patterns'.
1979
1980
1980 Test section lookup by translated message
1981 Test section lookup by translated message
1981
1982
1982 str.lower() instead of encoding.lower(str) on translated message might
1983 str.lower() instead of encoding.lower(str) on translated message might
1983 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1984 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1984 as the second or later byte of multi-byte character.
1985 as the second or later byte of multi-byte character.
1985
1986
1986 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1987 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1987 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1988 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1988 replacement makes message meaningless.
1989 replacement makes message meaningless.
1989
1990
1990 This tests that section lookup by translated string isn't broken by
1991 This tests that section lookup by translated string isn't broken by
1991 such str.lower().
1992 such str.lower().
1992
1993
1993 $ "$PYTHON" <<EOF
1994 $ "$PYTHON" <<EOF
1994 > def escape(s):
1995 > def escape(s):
1995 > return b''.join(br'\\u%x' % ord(uc) for uc in s.decode('cp932'))
1996 > return b''.join(br'\\u%x' % ord(uc) for uc in s.decode('cp932'))
1996 > # translation of "record" in ja_JP.cp932
1997 > # translation of "record" in ja_JP.cp932
1997 > upper = b"\x8bL\x98^"
1998 > upper = b"\x8bL\x98^"
1998 > # str.lower()-ed section name should be treated as different one
1999 > # str.lower()-ed section name should be treated as different one
1999 > lower = b"\x8bl\x98^"
2000 > lower = b"\x8bl\x98^"
2000 > with open('ambiguous.py', 'wb') as fp:
2001 > with open('ambiguous.py', 'wb') as fp:
2001 > fp.write(b"""# ambiguous section names in ja_JP.cp932
2002 > fp.write(b"""# ambiguous section names in ja_JP.cp932
2002 > u'''summary of extension
2003 > u'''summary of extension
2003 >
2004 >
2004 > %s
2005 > %s
2005 > ----
2006 > ----
2006 >
2007 >
2007 > Upper name should show only this message
2008 > Upper name should show only this message
2008 >
2009 >
2009 > %s
2010 > %s
2010 > ----
2011 > ----
2011 >
2012 >
2012 > Lower name should show only this message
2013 > Lower name should show only this message
2013 >
2014 >
2014 > subsequent section
2015 > subsequent section
2015 > ------------------
2016 > ------------------
2016 >
2017 >
2017 > This should be hidden at 'hg help ambiguous' with section name.
2018 > This should be hidden at 'hg help ambiguous' with section name.
2018 > '''
2019 > '''
2019 > """ % (escape(upper), escape(lower)))
2020 > """ % (escape(upper), escape(lower)))
2020 > EOF
2021 > EOF
2021
2022
2022 $ cat >> $HGRCPATH <<EOF
2023 $ cat >> $HGRCPATH <<EOF
2023 > [extensions]
2024 > [extensions]
2024 > ambiguous = ./ambiguous.py
2025 > ambiguous = ./ambiguous.py
2025 > EOF
2026 > EOF
2026
2027
2027 $ "$PYTHON" <<EOF | sh
2028 $ "$PYTHON" <<EOF | sh
2028 > from mercurial.utils import procutil
2029 > from mercurial.utils import procutil
2029 > upper = b"\x8bL\x98^"
2030 > upper = b"\x8bL\x98^"
2030 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper)
2031 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper)
2031 > EOF
2032 > EOF
2032 \x8bL\x98^ (esc)
2033 \x8bL\x98^ (esc)
2033 ----
2034 ----
2034
2035
2035 Upper name should show only this message
2036 Upper name should show only this message
2036
2037
2037
2038
2038 $ "$PYTHON" <<EOF | sh
2039 $ "$PYTHON" <<EOF | sh
2039 > from mercurial.utils import procutil
2040 > from mercurial.utils import procutil
2040 > lower = b"\x8bl\x98^"
2041 > lower = b"\x8bl\x98^"
2041 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower)
2042 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower)
2042 > EOF
2043 > EOF
2043 \x8bl\x98^ (esc)
2044 \x8bl\x98^ (esc)
2044 ----
2045 ----
2045
2046
2046 Lower name should show only this message
2047 Lower name should show only this message
2047
2048
2048
2049
2049 $ cat >> $HGRCPATH <<EOF
2050 $ cat >> $HGRCPATH <<EOF
2050 > [extensions]
2051 > [extensions]
2051 > ambiguous = !
2052 > ambiguous = !
2052 > EOF
2053 > EOF
2053
2054
2054 Show help content of disabled extensions
2055 Show help content of disabled extensions
2055
2056
2056 $ cat >> $HGRCPATH <<EOF
2057 $ cat >> $HGRCPATH <<EOF
2057 > [extensions]
2058 > [extensions]
2058 > ambiguous = !./ambiguous.py
2059 > ambiguous = !./ambiguous.py
2059 > EOF
2060 > EOF
2060 $ hg help -e ambiguous
2061 $ hg help -e ambiguous
2061 ambiguous extension - (no help text available)
2062 ambiguous extension - (no help text available)
2062
2063
2063 (use 'hg help extensions' for information on enabling extensions)
2064 (use 'hg help extensions' for information on enabling extensions)
2064
2065
2065 Test dynamic list of merge tools only shows up once
2066 Test dynamic list of merge tools only shows up once
2066 $ hg help merge-tools
2067 $ hg help merge-tools
2067 Merge Tools
2068 Merge Tools
2068 """""""""""
2069 """""""""""
2069
2070
2070 To merge files Mercurial uses merge tools.
2071 To merge files Mercurial uses merge tools.
2071
2072
2072 A merge tool combines two different versions of a file into a merged file.
2073 A merge tool combines two different versions of a file into a merged file.
2073 Merge tools are given the two files and the greatest common ancestor of
2074 Merge tools are given the two files and the greatest common ancestor of
2074 the two file versions, so they can determine the changes made on both
2075 the two file versions, so they can determine the changes made on both
2075 branches.
2076 branches.
2076
2077
2077 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
2078 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
2078 backout' and in several extensions.
2079 backout' and in several extensions.
2079
2080
2080 Usually, the merge tool tries to automatically reconcile the files by
2081 Usually, the merge tool tries to automatically reconcile the files by
2081 combining all non-overlapping changes that occurred separately in the two
2082 combining all non-overlapping changes that occurred separately in the two
2082 different evolutions of the same initial base file. Furthermore, some
2083 different evolutions of the same initial base file. Furthermore, some
2083 interactive merge programs make it easier to manually resolve conflicting
2084 interactive merge programs make it easier to manually resolve conflicting
2084 merges, either in a graphical way, or by inserting some conflict markers.
2085 merges, either in a graphical way, or by inserting some conflict markers.
2085 Mercurial does not include any interactive merge programs but relies on
2086 Mercurial does not include any interactive merge programs but relies on
2086 external tools for that.
2087 external tools for that.
2087
2088
2088 Available merge tools
2089 Available merge tools
2089 =====================
2090 =====================
2090
2091
2091 External merge tools and their properties are configured in the merge-
2092 External merge tools and their properties are configured in the merge-
2092 tools configuration section - see hgrc(5) - but they can often just be
2093 tools configuration section - see hgrc(5) - but they can often just be
2093 named by their executable.
2094 named by their executable.
2094
2095
2095 A merge tool is generally usable if its executable can be found on the
2096 A merge tool is generally usable if its executable can be found on the
2096 system and if it can handle the merge. The executable is found if it is an
2097 system and if it can handle the merge. The executable is found if it is an
2097 absolute or relative executable path or the name of an application in the
2098 absolute or relative executable path or the name of an application in the
2098 executable search path. The tool is assumed to be able to handle the merge
2099 executable search path. The tool is assumed to be able to handle the merge
2099 if it can handle symlinks if the file is a symlink, if it can handle
2100 if it can handle symlinks if the file is a symlink, if it can handle
2100 binary files if the file is binary, and if a GUI is available if the tool
2101 binary files if the file is binary, and if a GUI is available if the tool
2101 requires a GUI.
2102 requires a GUI.
2102
2103
2103 There are some internal merge tools which can be used. The internal merge
2104 There are some internal merge tools which can be used. The internal merge
2104 tools are:
2105 tools are:
2105
2106
2106 ":dump"
2107 ":dump"
2107 Creates three versions of the files to merge, containing the contents of
2108 Creates three versions of the files to merge, containing the contents of
2108 local, other and base. These files can then be used to perform a merge
2109 local, other and base. These files can then be used to perform a merge
2109 manually. If the file to be merged is named "a.txt", these files will
2110 manually. If the file to be merged is named "a.txt", these files will
2110 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
2111 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
2111 they will be placed in the same directory as "a.txt".
2112 they will be placed in the same directory as "a.txt".
2112
2113
2113 This implies premerge. Therefore, files aren't dumped, if premerge runs
2114 This implies premerge. Therefore, files aren't dumped, if premerge runs
2114 successfully. Use :forcedump to forcibly write files out.
2115 successfully. Use :forcedump to forcibly write files out.
2115
2116
2116 (actual capabilities: binary, symlink)
2117 (actual capabilities: binary, symlink)
2117
2118
2118 ":fail"
2119 ":fail"
2119 Rather than attempting to merge files that were modified on both
2120 Rather than attempting to merge files that were modified on both
2120 branches, it marks them as unresolved. The resolve command must be used
2121 branches, it marks them as unresolved. The resolve command must be used
2121 to resolve these conflicts.
2122 to resolve these conflicts.
2122
2123
2123 (actual capabilities: binary, symlink)
2124 (actual capabilities: binary, symlink)
2124
2125
2125 ":forcedump"
2126 ":forcedump"
2126 Creates three versions of the files as same as :dump, but omits
2127 Creates three versions of the files as same as :dump, but omits
2127 premerge.
2128 premerge.
2128
2129
2129 (actual capabilities: binary, symlink)
2130 (actual capabilities: binary, symlink)
2130
2131
2131 ":local"
2132 ":local"
2132 Uses the local 'p1()' version of files as the merged version.
2133 Uses the local 'p1()' version of files as the merged version.
2133
2134
2134 (actual capabilities: binary, symlink)
2135 (actual capabilities: binary, symlink)
2135
2136
2136 ":merge"
2137 ":merge"
2137 Uses the internal non-interactive simple merge algorithm for merging
2138 Uses the internal non-interactive simple merge algorithm for merging
2138 files. It will fail if there are any conflicts and leave markers in the
2139 files. It will fail if there are any conflicts and leave markers in the
2139 partially merged file. Markers will have two sections, one for each side
2140 partially merged file. Markers will have two sections, one for each side
2140 of merge.
2141 of merge.
2141
2142
2142 ":merge-local"
2143 ":merge-local"
2143 Like :merge, but resolve all conflicts non-interactively in favor of the
2144 Like :merge, but resolve all conflicts non-interactively in favor of the
2144 local 'p1()' changes.
2145 local 'p1()' changes.
2145
2146
2146 ":merge-other"
2147 ":merge-other"
2147 Like :merge, but resolve all conflicts non-interactively in favor of the
2148 Like :merge, but resolve all conflicts non-interactively in favor of the
2148 other 'p2()' changes.
2149 other 'p2()' changes.
2149
2150
2150 ":merge3"
2151 ":merge3"
2151 Uses the internal non-interactive simple merge algorithm for merging
2152 Uses the internal non-interactive simple merge algorithm for merging
2152 files. It will fail if there are any conflicts and leave markers in the
2153 files. It will fail if there are any conflicts and leave markers in the
2153 partially merged file. Marker will have three sections, one from each
2154 partially merged file. Marker will have three sections, one from each
2154 side of the merge and one for the base content.
2155 side of the merge and one for the base content.
2155
2156
2156 ":mergediff"
2157 ":mergediff"
2157 Uses the internal non-interactive simple merge algorithm for merging
2158 Uses the internal non-interactive simple merge algorithm for merging
2158 files. It will fail if there are any conflicts and leave markers in the
2159 files. It will fail if there are any conflicts and leave markers in the
2159 partially merged file. The marker will have two sections, one with the
2160 partially merged file. The marker will have two sections, one with the
2160 content from one side of the merge, and one with a diff from the base
2161 content from one side of the merge, and one with a diff from the base
2161 content to the content on the other side. (experimental)
2162 content to the content on the other side. (experimental)
2162
2163
2163 ":other"
2164 ":other"
2164 Uses the other 'p2()' version of files as the merged version.
2165 Uses the other 'p2()' version of files as the merged version.
2165
2166
2166 (actual capabilities: binary, symlink)
2167 (actual capabilities: binary, symlink)
2167
2168
2168 ":prompt"
2169 ":prompt"
2169 Asks the user which of the local 'p1()' or the other 'p2()' version to
2170 Asks the user which of the local 'p1()' or the other 'p2()' version to
2170 keep as the merged version.
2171 keep as the merged version.
2171
2172
2172 (actual capabilities: binary, symlink)
2173 (actual capabilities: binary, symlink)
2173
2174
2174 ":tagmerge"
2175 ":tagmerge"
2175 Uses the internal tag merge algorithm (experimental).
2176 Uses the internal tag merge algorithm (experimental).
2176
2177
2177 ":union"
2178 ":union"
2178 Uses the internal non-interactive simple merge algorithm for merging
2179 Uses the internal non-interactive simple merge algorithm for merging
2179 files. It will use both local and other sides for conflict regions by
2180 files. It will use both local and other sides for conflict regions by
2180 adding local on top of other. No markers are inserted.
2181 adding local on top of other. No markers are inserted.
2181
2182
2182 ":union-other-first"
2183 ":union-other-first"
2183 Like :union, but add other on top of local.
2184 Like :union, but add other on top of local.
2184
2185
2185 Internal tools are always available and do not require a GUI but will by
2186 Internal tools are always available and do not require a GUI but will by
2186 default not handle symlinks or binary files. See next section for detail
2187 default not handle symlinks or binary files. See next section for detail
2187 about "actual capabilities" described above.
2188 about "actual capabilities" described above.
2188
2189
2189 Choosing a merge tool
2190 Choosing a merge tool
2190 =====================
2191 =====================
2191
2192
2192 Mercurial uses these rules when deciding which merge tool to use:
2193 Mercurial uses these rules when deciding which merge tool to use:
2193
2194
2194 1. If a tool has been specified with the --tool option to merge or
2195 1. If a tool has been specified with the --tool option to merge or
2195 resolve, it is used. If it is the name of a tool in the merge-tools
2196 resolve, it is used. If it is the name of a tool in the merge-tools
2196 configuration, its configuration is used. Otherwise the specified tool
2197 configuration, its configuration is used. Otherwise the specified tool
2197 must be executable by the shell.
2198 must be executable by the shell.
2198 2. If the "HGMERGE" environment variable is present, its value is used and
2199 2. If the "HGMERGE" environment variable is present, its value is used and
2199 must be executable by the shell.
2200 must be executable by the shell.
2200 3. If the filename of the file to be merged matches any of the patterns in
2201 3. If the filename of the file to be merged matches any of the patterns in
2201 the merge-patterns configuration section, the first usable merge tool
2202 the merge-patterns configuration section, the first usable merge tool
2202 corresponding to a matching pattern is used.
2203 corresponding to a matching pattern is used.
2203 4. If ui.merge is set it will be considered next. If the value is not the
2204 4. If ui.merge is set it will be considered next. If the value is not the
2204 name of a configured tool, the specified value is used and must be
2205 name of a configured tool, the specified value is used and must be
2205 executable by the shell. Otherwise the named tool is used if it is
2206 executable by the shell. Otherwise the named tool is used if it is
2206 usable.
2207 usable.
2207 5. If any usable merge tools are present in the merge-tools configuration
2208 5. If any usable merge tools are present in the merge-tools configuration
2208 section, the one with the highest priority is used.
2209 section, the one with the highest priority is used.
2209 6. If a program named "hgmerge" can be found on the system, it is used -
2210 6. If a program named "hgmerge" can be found on the system, it is used -
2210 but it will by default not be used for symlinks and binary files.
2211 but it will by default not be used for symlinks and binary files.
2211 7. If the file to be merged is not binary and is not a symlink, then
2212 7. If the file to be merged is not binary and is not a symlink, then
2212 internal ":merge" is used.
2213 internal ":merge" is used.
2213 8. Otherwise, ":prompt" is used.
2214 8. Otherwise, ":prompt" is used.
2214
2215
2215 For historical reason, Mercurial treats merge tools as below while
2216 For historical reason, Mercurial treats merge tools as below while
2216 examining rules above.
2217 examining rules above.
2217
2218
2218 step specified via binary symlink
2219 step specified via binary symlink
2219 ----------------------------------
2220 ----------------------------------
2220 1. --tool o/o o/o
2221 1. --tool o/o o/o
2221 2. HGMERGE o/o o/o
2222 2. HGMERGE o/o o/o
2222 3. merge-patterns o/o(*) x/?(*)
2223 3. merge-patterns o/o(*) x/?(*)
2223 4. ui.merge x/?(*) x/?(*)
2224 4. ui.merge x/?(*) x/?(*)
2224
2225
2225 Each capability column indicates Mercurial behavior for internal/external
2226 Each capability column indicates Mercurial behavior for internal/external
2226 merge tools at examining each rule.
2227 merge tools at examining each rule.
2227
2228
2228 - "o": "assume that a tool has capability"
2229 - "o": "assume that a tool has capability"
2229 - "x": "assume that a tool does not have capability"
2230 - "x": "assume that a tool does not have capability"
2230 - "?": "check actual capability of a tool"
2231 - "?": "check actual capability of a tool"
2231
2232
2232 If "merge.strict-capability-check" configuration is true, Mercurial checks
2233 If "merge.strict-capability-check" configuration is true, Mercurial checks
2233 capabilities of merge tools strictly in (*) cases above (= each capability
2234 capabilities of merge tools strictly in (*) cases above (= each capability
2234 column becomes "?/?"). It is false by default for backward compatibility.
2235 column becomes "?/?"). It is false by default for backward compatibility.
2235
2236
2236 Note:
2237 Note:
2237 After selecting a merge program, Mercurial will by default attempt to
2238 After selecting a merge program, Mercurial will by default attempt to
2238 merge the files using a simple merge algorithm first. Only if it
2239 merge the files using a simple merge algorithm first. Only if it
2239 doesn't succeed because of conflicting changes will Mercurial actually
2240 doesn't succeed because of conflicting changes will Mercurial actually
2240 execute the merge program. Whether to use the simple merge algorithm
2241 execute the merge program. Whether to use the simple merge algorithm
2241 first can be controlled by the premerge setting of the merge tool.
2242 first can be controlled by the premerge setting of the merge tool.
2242 Premerge is enabled by default unless the file is binary or a symlink.
2243 Premerge is enabled by default unless the file is binary or a symlink.
2243
2244
2244 See the merge-tools and ui sections of hgrc(5) for details on the
2245 See the merge-tools and ui sections of hgrc(5) for details on the
2245 configuration of merge tools.
2246 configuration of merge tools.
2246
2247
2247 Compression engines listed in `hg help bundlespec`
2248 Compression engines listed in `hg help bundlespec`
2248
2249
2249 $ hg help bundlespec | grep gzip
2250 $ hg help bundlespec | grep gzip
2250 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
2251 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
2251 An algorithm that produces smaller bundles than "gzip".
2252 An algorithm that produces smaller bundles than "gzip".
2252 This engine will likely produce smaller bundles than "gzip" but will be
2253 This engine will likely produce smaller bundles than "gzip" but will be
2253 "gzip"
2254 "gzip"
2254 better compression than "gzip". It also frequently yields better (?)
2255 better compression than "gzip". It also frequently yields better (?)
2255
2256
2256 Test usage of section marks in help documents
2257 Test usage of section marks in help documents
2257
2258
2258 $ cd "$TESTDIR"/../doc
2259 $ cd "$TESTDIR"/../doc
2259 $ "$PYTHON" check-seclevel.py
2260 $ "$PYTHON" check-seclevel.py
2260 $ cd $TESTTMP
2261 $ cd $TESTTMP
2261
2262
2262 #if serve
2263 #if serve
2263
2264
2264 Test the help pages in hgweb.
2265 Test the help pages in hgweb.
2265
2266
2266 Dish up an empty repo; serve it cold.
2267 Dish up an empty repo; serve it cold.
2267
2268
2268 $ hg init "$TESTTMP/test"
2269 $ hg init "$TESTTMP/test"
2269 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
2270 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
2270 $ cat hg.pid >> $DAEMON_PIDS
2271 $ cat hg.pid >> $DAEMON_PIDS
2271
2272
2272 $ get-with-headers.py $LOCALIP:$HGPORT "help"
2273 $ get-with-headers.py $LOCALIP:$HGPORT "help"
2273 200 Script output follows
2274 200 Script output follows
2274
2275
2275 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2276 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2276 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2277 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2277 <head>
2278 <head>
2278 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2279 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2279 <meta name="robots" content="index, nofollow" />
2280 <meta name="robots" content="index, nofollow" />
2280 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2281 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2281 <script type="text/javascript" src="/static/mercurial.js"></script>
2282 <script type="text/javascript" src="/static/mercurial.js"></script>
2282
2283
2283 <title>Help: Index</title>
2284 <title>Help: Index</title>
2284 </head>
2285 </head>
2285 <body>
2286 <body>
2286
2287
2287 <div class="container">
2288 <div class="container">
2288 <div class="menu">
2289 <div class="menu">
2289 <div class="logo">
2290 <div class="logo">
2290 <a href="https://mercurial-scm.org/">
2291 <a href="https://mercurial-scm.org/">
2291 <img src="/static/hglogo.png" alt="mercurial" /></a>
2292 <img src="/static/hglogo.png" alt="mercurial" /></a>
2292 </div>
2293 </div>
2293 <ul>
2294 <ul>
2294 <li><a href="/shortlog">log</a></li>
2295 <li><a href="/shortlog">log</a></li>
2295 <li><a href="/graph">graph</a></li>
2296 <li><a href="/graph">graph</a></li>
2296 <li><a href="/tags">tags</a></li>
2297 <li><a href="/tags">tags</a></li>
2297 <li><a href="/bookmarks">bookmarks</a></li>
2298 <li><a href="/bookmarks">bookmarks</a></li>
2298 <li><a href="/branches">branches</a></li>
2299 <li><a href="/branches">branches</a></li>
2299 </ul>
2300 </ul>
2300 <ul>
2301 <ul>
2301 <li class="active">help</li>
2302 <li class="active">help</li>
2302 </ul>
2303 </ul>
2303 </div>
2304 </div>
2304
2305
2305 <div class="main">
2306 <div class="main">
2306 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2307 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2307
2308
2308 <form class="search" action="/log">
2309 <form class="search" action="/log">
2309
2310
2310 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2311 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2311 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2312 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2312 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2313 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2313 </form>
2314 </form>
2314 <table class="bigtable">
2315 <table class="bigtable">
2315 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2316 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2316
2317
2317 <tr><td>
2318 <tr><td>
2318 <a href="/help/bundlespec">
2319 <a href="/help/bundlespec">
2319 bundlespec
2320 bundlespec
2320 </a>
2321 </a>
2321 </td><td>
2322 </td><td>
2322 Bundle File Formats
2323 Bundle File Formats
2323 </td></tr>
2324 </td></tr>
2324 <tr><td>
2325 <tr><td>
2325 <a href="/help/color">
2326 <a href="/help/color">
2326 color
2327 color
2327 </a>
2328 </a>
2328 </td><td>
2329 </td><td>
2329 Colorizing Outputs
2330 Colorizing Outputs
2330 </td></tr>
2331 </td></tr>
2331 <tr><td>
2332 <tr><td>
2332 <a href="/help/config">
2333 <a href="/help/config">
2333 config
2334 config
2334 </a>
2335 </a>
2335 </td><td>
2336 </td><td>
2336 Configuration Files
2337 Configuration Files
2337 </td></tr>
2338 </td></tr>
2338 <tr><td>
2339 <tr><td>
2339 <a href="/help/dates">
2340 <a href="/help/dates">
2340 dates
2341 dates
2341 </a>
2342 </a>
2342 </td><td>
2343 </td><td>
2343 Date Formats
2344 Date Formats
2344 </td></tr>
2345 </td></tr>
2345 <tr><td>
2346 <tr><td>
2346 <a href="/help/deprecated">
2347 <a href="/help/deprecated">
2347 deprecated
2348 deprecated
2348 </a>
2349 </a>
2349 </td><td>
2350 </td><td>
2350 Deprecated Features
2351 Deprecated Features
2351 </td></tr>
2352 </td></tr>
2352 <tr><td>
2353 <tr><td>
2353 <a href="/help/diffs">
2354 <a href="/help/diffs">
2354 diffs
2355 diffs
2355 </a>
2356 </a>
2356 </td><td>
2357 </td><td>
2357 Diff Formats
2358 Diff Formats
2358 </td></tr>
2359 </td></tr>
2359 <tr><td>
2360 <tr><td>
2360 <a href="/help/environment">
2361 <a href="/help/environment">
2361 environment
2362 environment
2362 </a>
2363 </a>
2363 </td><td>
2364 </td><td>
2364 Environment Variables
2365 Environment Variables
2365 </td></tr>
2366 </td></tr>
2366 <tr><td>
2367 <tr><td>
2367 <a href="/help/evolution">
2368 <a href="/help/evolution">
2368 evolution
2369 evolution
2369 </a>
2370 </a>
2370 </td><td>
2371 </td><td>
2371 Safely rewriting history (EXPERIMENTAL)
2372 Safely rewriting history (EXPERIMENTAL)
2372 </td></tr>
2373 </td></tr>
2373 <tr><td>
2374 <tr><td>
2374 <a href="/help/extensions">
2375 <a href="/help/extensions">
2375 extensions
2376 extensions
2376 </a>
2377 </a>
2377 </td><td>
2378 </td><td>
2378 Using Additional Features
2379 Using Additional Features
2379 </td></tr>
2380 </td></tr>
2380 <tr><td>
2381 <tr><td>
2381 <a href="/help/filesets">
2382 <a href="/help/filesets">
2382 filesets
2383 filesets
2383 </a>
2384 </a>
2384 </td><td>
2385 </td><td>
2385 Specifying File Sets
2386 Specifying File Sets
2386 </td></tr>
2387 </td></tr>
2387 <tr><td>
2388 <tr><td>
2388 <a href="/help/flags">
2389 <a href="/help/flags">
2389 flags
2390 flags
2390 </a>
2391 </a>
2391 </td><td>
2392 </td><td>
2392 Command-line flags
2393 Command-line flags
2393 </td></tr>
2394 </td></tr>
2394 <tr><td>
2395 <tr><td>
2395 <a href="/help/glossary">
2396 <a href="/help/glossary">
2396 glossary
2397 glossary
2397 </a>
2398 </a>
2398 </td><td>
2399 </td><td>
2399 Glossary
2400 Glossary
2400 </td></tr>
2401 </td></tr>
2401 <tr><td>
2402 <tr><td>
2402 <a href="/help/hgignore">
2403 <a href="/help/hgignore">
2403 hgignore
2404 hgignore
2404 </a>
2405 </a>
2405 </td><td>
2406 </td><td>
2406 Syntax for Mercurial Ignore Files
2407 Syntax for Mercurial Ignore Files
2407 </td></tr>
2408 </td></tr>
2408 <tr><td>
2409 <tr><td>
2409 <a href="/help/hgweb">
2410 <a href="/help/hgweb">
2410 hgweb
2411 hgweb
2411 </a>
2412 </a>
2412 </td><td>
2413 </td><td>
2413 Configuring hgweb
2414 Configuring hgweb
2414 </td></tr>
2415 </td></tr>
2415 <tr><td>
2416 <tr><td>
2416 <a href="/help/internals">
2417 <a href="/help/internals">
2417 internals
2418 internals
2418 </a>
2419 </a>
2419 </td><td>
2420 </td><td>
2420 Technical implementation topics
2421 Technical implementation topics
2421 </td></tr>
2422 </td></tr>
2422 <tr><td>
2423 <tr><td>
2423 <a href="/help/merge-tools">
2424 <a href="/help/merge-tools">
2424 merge-tools
2425 merge-tools
2425 </a>
2426 </a>
2426 </td><td>
2427 </td><td>
2427 Merge Tools
2428 Merge Tools
2428 </td></tr>
2429 </td></tr>
2429 <tr><td>
2430 <tr><td>
2430 <a href="/help/pager">
2431 <a href="/help/pager">
2431 pager
2432 pager
2432 </a>
2433 </a>
2433 </td><td>
2434 </td><td>
2434 Pager Support
2435 Pager Support
2435 </td></tr>
2436 </td></tr>
2436 <tr><td>
2437 <tr><td>
2437 <a href="/help/patterns">
2438 <a href="/help/patterns">
2438 patterns
2439 patterns
2439 </a>
2440 </a>
2440 </td><td>
2441 </td><td>
2441 File Name Patterns
2442 File Name Patterns
2442 </td></tr>
2443 </td></tr>
2443 <tr><td>
2444 <tr><td>
2444 <a href="/help/phases">
2445 <a href="/help/phases">
2445 phases
2446 phases
2446 </a>
2447 </a>
2447 </td><td>
2448 </td><td>
2448 Working with Phases
2449 Working with Phases
2449 </td></tr>
2450 </td></tr>
2450 <tr><td>
2451 <tr><td>
2451 <a href="/help/revisions">
2452 <a href="/help/revisions">
2452 revisions
2453 revisions
2453 </a>
2454 </a>
2454 </td><td>
2455 </td><td>
2455 Specifying Revisions
2456 Specifying Revisions
2456 </td></tr>
2457 </td></tr>
2457 <tr><td>
2458 <tr><td>
2458 <a href="/help/rust">
2459 <a href="/help/rust">
2459 rust
2460 rust
2460 </a>
2461 </a>
2461 </td><td>
2462 </td><td>
2462 Rust in Mercurial
2463 Rust in Mercurial
2463 </td></tr>
2464 </td></tr>
2464 <tr><td>
2465 <tr><td>
2465 <a href="/help/scripting">
2466 <a href="/help/scripting">
2466 scripting
2467 scripting
2467 </a>
2468 </a>
2468 </td><td>
2469 </td><td>
2469 Using Mercurial from scripts and automation
2470 Using Mercurial from scripts and automation
2470 </td></tr>
2471 </td></tr>
2471 <tr><td>
2472 <tr><td>
2472 <a href="/help/subrepos">
2473 <a href="/help/subrepos">
2473 subrepos
2474 subrepos
2474 </a>
2475 </a>
2475 </td><td>
2476 </td><td>
2476 Subrepositories
2477 Subrepositories
2477 </td></tr>
2478 </td></tr>
2478 <tr><td>
2479 <tr><td>
2479 <a href="/help/templating">
2480 <a href="/help/templating">
2480 templating
2481 templating
2481 </a>
2482 </a>
2482 </td><td>
2483 </td><td>
2483 Template Usage
2484 Template Usage
2484 </td></tr>
2485 </td></tr>
2485 <tr><td>
2486 <tr><td>
2486 <a href="/help/urls">
2487 <a href="/help/urls">
2487 urls
2488 urls
2488 </a>
2489 </a>
2489 </td><td>
2490 </td><td>
2490 URL Paths
2491 URL Paths
2491 </td></tr>
2492 </td></tr>
2492 <tr><td>
2493 <tr><td>
2493 <a href="/help/topic-containing-verbose">
2494 <a href="/help/topic-containing-verbose">
2494 topic-containing-verbose
2495 topic-containing-verbose
2495 </a>
2496 </a>
2496 </td><td>
2497 </td><td>
2497 This is the topic to test omit indicating.
2498 This is the topic to test omit indicating.
2498 </td></tr>
2499 </td></tr>
2499
2500
2500
2501
2501 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2502 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2502
2503
2503 <tr><td>
2504 <tr><td>
2504 <a href="/help/abort">
2505 <a href="/help/abort">
2505 abort
2506 abort
2506 </a>
2507 </a>
2507 </td><td>
2508 </td><td>
2508 abort an unfinished operation (EXPERIMENTAL)
2509 abort an unfinished operation (EXPERIMENTAL)
2509 </td></tr>
2510 </td></tr>
2510 <tr><td>
2511 <tr><td>
2511 <a href="/help/add">
2512 <a href="/help/add">
2512 add
2513 add
2513 </a>
2514 </a>
2514 </td><td>
2515 </td><td>
2515 add the specified files on the next commit
2516 add the specified files on the next commit
2516 </td></tr>
2517 </td></tr>
2517 <tr><td>
2518 <tr><td>
2518 <a href="/help/annotate">
2519 <a href="/help/annotate">
2519 annotate
2520 annotate
2520 </a>
2521 </a>
2521 </td><td>
2522 </td><td>
2522 show changeset information by line for each file
2523 show changeset information by line for each file
2523 </td></tr>
2524 </td></tr>
2524 <tr><td>
2525 <tr><td>
2525 <a href="/help/clone">
2526 <a href="/help/clone">
2526 clone
2527 clone
2527 </a>
2528 </a>
2528 </td><td>
2529 </td><td>
2529 make a copy of an existing repository
2530 make a copy of an existing repository
2530 </td></tr>
2531 </td></tr>
2531 <tr><td>
2532 <tr><td>
2532 <a href="/help/commit">
2533 <a href="/help/commit">
2533 commit
2534 commit
2534 </a>
2535 </a>
2535 </td><td>
2536 </td><td>
2536 commit the specified files or all outstanding changes
2537 commit the specified files or all outstanding changes
2537 </td></tr>
2538 </td></tr>
2538 <tr><td>
2539 <tr><td>
2539 <a href="/help/continue">
2540 <a href="/help/continue">
2540 continue
2541 continue
2541 </a>
2542 </a>
2542 </td><td>
2543 </td><td>
2543 resumes an interrupted operation (EXPERIMENTAL)
2544 resumes an interrupted operation (EXPERIMENTAL)
2544 </td></tr>
2545 </td></tr>
2545 <tr><td>
2546 <tr><td>
2546 <a href="/help/diff">
2547 <a href="/help/diff">
2547 diff
2548 diff
2548 </a>
2549 </a>
2549 </td><td>
2550 </td><td>
2550 diff repository (or selected files)
2551 diff repository (or selected files)
2551 </td></tr>
2552 </td></tr>
2552 <tr><td>
2553 <tr><td>
2553 <a href="/help/export">
2554 <a href="/help/export">
2554 export
2555 export
2555 </a>
2556 </a>
2556 </td><td>
2557 </td><td>
2557 dump the header and diffs for one or more changesets
2558 dump the header and diffs for one or more changesets
2558 </td></tr>
2559 </td></tr>
2559 <tr><td>
2560 <tr><td>
2560 <a href="/help/forget">
2561 <a href="/help/forget">
2561 forget
2562 forget
2562 </a>
2563 </a>
2563 </td><td>
2564 </td><td>
2564 forget the specified files on the next commit
2565 forget the specified files on the next commit
2565 </td></tr>
2566 </td></tr>
2566 <tr><td>
2567 <tr><td>
2567 <a href="/help/init">
2568 <a href="/help/init">
2568 init
2569 init
2569 </a>
2570 </a>
2570 </td><td>
2571 </td><td>
2571 create a new repository in the given directory
2572 create a new repository in the given directory
2572 </td></tr>
2573 </td></tr>
2573 <tr><td>
2574 <tr><td>
2574 <a href="/help/log">
2575 <a href="/help/log">
2575 log
2576 log
2576 </a>
2577 </a>
2577 </td><td>
2578 </td><td>
2578 show revision history of entire repository or files
2579 show revision history of entire repository or files
2579 </td></tr>
2580 </td></tr>
2580 <tr><td>
2581 <tr><td>
2581 <a href="/help/merge">
2582 <a href="/help/merge">
2582 merge
2583 merge
2583 </a>
2584 </a>
2584 </td><td>
2585 </td><td>
2585 merge another revision into working directory
2586 merge another revision into working directory
2586 </td></tr>
2587 </td></tr>
2587 <tr><td>
2588 <tr><td>
2588 <a href="/help/pull">
2589 <a href="/help/pull">
2589 pull
2590 pull
2590 </a>
2591 </a>
2591 </td><td>
2592 </td><td>
2592 pull changes from the specified source
2593 pull changes from the specified source
2593 </td></tr>
2594 </td></tr>
2594 <tr><td>
2595 <tr><td>
2595 <a href="/help/push">
2596 <a href="/help/push">
2596 push
2597 push
2597 </a>
2598 </a>
2598 </td><td>
2599 </td><td>
2599 push changes to the specified destination
2600 push changes to the specified destination
2600 </td></tr>
2601 </td></tr>
2601 <tr><td>
2602 <tr><td>
2602 <a href="/help/remove">
2603 <a href="/help/remove">
2603 remove
2604 remove
2604 </a>
2605 </a>
2605 </td><td>
2606 </td><td>
2606 remove the specified files on the next commit
2607 remove the specified files on the next commit
2607 </td></tr>
2608 </td></tr>
2608 <tr><td>
2609 <tr><td>
2609 <a href="/help/serve">
2610 <a href="/help/serve">
2610 serve
2611 serve
2611 </a>
2612 </a>
2612 </td><td>
2613 </td><td>
2613 start stand-alone webserver
2614 start stand-alone webserver
2614 </td></tr>
2615 </td></tr>
2615 <tr><td>
2616 <tr><td>
2616 <a href="/help/status">
2617 <a href="/help/status">
2617 status
2618 status
2618 </a>
2619 </a>
2619 </td><td>
2620 </td><td>
2620 show changed files in the working directory
2621 show changed files in the working directory
2621 </td></tr>
2622 </td></tr>
2622 <tr><td>
2623 <tr><td>
2623 <a href="/help/summary">
2624 <a href="/help/summary">
2624 summary
2625 summary
2625 </a>
2626 </a>
2626 </td><td>
2627 </td><td>
2627 summarize working directory state
2628 summarize working directory state
2628 </td></tr>
2629 </td></tr>
2629 <tr><td>
2630 <tr><td>
2630 <a href="/help/update">
2631 <a href="/help/update">
2631 update
2632 update
2632 </a>
2633 </a>
2633 </td><td>
2634 </td><td>
2634 update working directory (or switch revisions)
2635 update working directory (or switch revisions)
2635 </td></tr>
2636 </td></tr>
2636
2637
2637
2638
2638
2639
2639 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2640 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2640
2641
2641 <tr><td>
2642 <tr><td>
2642 <a href="/help/addremove">
2643 <a href="/help/addremove">
2643 addremove
2644 addremove
2644 </a>
2645 </a>
2645 </td><td>
2646 </td><td>
2646 add all new files, delete all missing files
2647 add all new files, delete all missing files
2647 </td></tr>
2648 </td></tr>
2648 <tr><td>
2649 <tr><td>
2649 <a href="/help/archive">
2650 <a href="/help/archive">
2650 archive
2651 archive
2651 </a>
2652 </a>
2652 </td><td>
2653 </td><td>
2653 create an unversioned archive of a repository revision
2654 create an unversioned archive of a repository revision
2654 </td></tr>
2655 </td></tr>
2655 <tr><td>
2656 <tr><td>
2656 <a href="/help/backout">
2657 <a href="/help/backout">
2657 backout
2658 backout
2658 </a>
2659 </a>
2659 </td><td>
2660 </td><td>
2660 reverse effect of earlier changeset
2661 reverse effect of earlier changeset
2661 </td></tr>
2662 </td></tr>
2662 <tr><td>
2663 <tr><td>
2663 <a href="/help/bisect">
2664 <a href="/help/bisect">
2664 bisect
2665 bisect
2665 </a>
2666 </a>
2666 </td><td>
2667 </td><td>
2667 subdivision search of changesets
2668 subdivision search of changesets
2668 </td></tr>
2669 </td></tr>
2669 <tr><td>
2670 <tr><td>
2670 <a href="/help/bookmarks">
2671 <a href="/help/bookmarks">
2671 bookmarks
2672 bookmarks
2672 </a>
2673 </a>
2673 </td><td>
2674 </td><td>
2674 create a new bookmark or list existing bookmarks
2675 create a new bookmark or list existing bookmarks
2675 </td></tr>
2676 </td></tr>
2676 <tr><td>
2677 <tr><td>
2677 <a href="/help/branch">
2678 <a href="/help/branch">
2678 branch
2679 branch
2679 </a>
2680 </a>
2680 </td><td>
2681 </td><td>
2681 set or show the current branch name
2682 set or show the current branch name
2682 </td></tr>
2683 </td></tr>
2683 <tr><td>
2684 <tr><td>
2684 <a href="/help/branches">
2685 <a href="/help/branches">
2685 branches
2686 branches
2686 </a>
2687 </a>
2687 </td><td>
2688 </td><td>
2688 list repository named branches
2689 list repository named branches
2689 </td></tr>
2690 </td></tr>
2690 <tr><td>
2691 <tr><td>
2691 <a href="/help/bundle">
2692 <a href="/help/bundle">
2692 bundle
2693 bundle
2693 </a>
2694 </a>
2694 </td><td>
2695 </td><td>
2695 create a bundle file
2696 create a bundle file
2696 </td></tr>
2697 </td></tr>
2697 <tr><td>
2698 <tr><td>
2698 <a href="/help/cat">
2699 <a href="/help/cat">
2699 cat
2700 cat
2700 </a>
2701 </a>
2701 </td><td>
2702 </td><td>
2702 output the current or given revision of files
2703 output the current or given revision of files
2703 </td></tr>
2704 </td></tr>
2704 <tr><td>
2705 <tr><td>
2705 <a href="/help/config">
2706 <a href="/help/config">
2706 config
2707 config
2707 </a>
2708 </a>
2708 </td><td>
2709 </td><td>
2709 show combined config settings from all hgrc files
2710 show combined config settings from all hgrc files
2710 </td></tr>
2711 </td></tr>
2711 <tr><td>
2712 <tr><td>
2712 <a href="/help/copy">
2713 <a href="/help/copy">
2713 copy
2714 copy
2714 </a>
2715 </a>
2715 </td><td>
2716 </td><td>
2716 mark files as copied for the next commit
2717 mark files as copied for the next commit
2717 </td></tr>
2718 </td></tr>
2718 <tr><td>
2719 <tr><td>
2719 <a href="/help/files">
2720 <a href="/help/files">
2720 files
2721 files
2721 </a>
2722 </a>
2722 </td><td>
2723 </td><td>
2723 list tracked files
2724 list tracked files
2724 </td></tr>
2725 </td></tr>
2725 <tr><td>
2726 <tr><td>
2726 <a href="/help/graft">
2727 <a href="/help/graft">
2727 graft
2728 graft
2728 </a>
2729 </a>
2729 </td><td>
2730 </td><td>
2730 copy changes from other branches onto the current branch
2731 copy changes from other branches onto the current branch
2731 </td></tr>
2732 </td></tr>
2732 <tr><td>
2733 <tr><td>
2733 <a href="/help/grep">
2734 <a href="/help/grep">
2734 grep
2735 grep
2735 </a>
2736 </a>
2736 </td><td>
2737 </td><td>
2737 search for a pattern in specified files
2738 search for a pattern in specified files
2738 </td></tr>
2739 </td></tr>
2739 <tr><td>
2740 <tr><td>
2740 <a href="/help/hashelp">
2741 <a href="/help/hashelp">
2741 hashelp
2742 hashelp
2742 </a>
2743 </a>
2743 </td><td>
2744 </td><td>
2744 Extension command's help
2745 Extension command's help
2745 </td></tr>
2746 </td></tr>
2746 <tr><td>
2747 <tr><td>
2747 <a href="/help/heads">
2748 <a href="/help/heads">
2748 heads
2749 heads
2749 </a>
2750 </a>
2750 </td><td>
2751 </td><td>
2751 show branch heads
2752 show branch heads
2752 </td></tr>
2753 </td></tr>
2753 <tr><td>
2754 <tr><td>
2754 <a href="/help/help">
2755 <a href="/help/help">
2755 help
2756 help
2756 </a>
2757 </a>
2757 </td><td>
2758 </td><td>
2758 show help for a given topic or a help overview
2759 show help for a given topic or a help overview
2759 </td></tr>
2760 </td></tr>
2760 <tr><td>
2761 <tr><td>
2761 <a href="/help/hgalias">
2762 <a href="/help/hgalias">
2762 hgalias
2763 hgalias
2763 </a>
2764 </a>
2764 </td><td>
2765 </td><td>
2765 My doc
2766 My doc
2766 </td></tr>
2767 </td></tr>
2767 <tr><td>
2768 <tr><td>
2768 <a href="/help/hgaliasnodoc">
2769 <a href="/help/hgaliasnodoc">
2769 hgaliasnodoc
2770 hgaliasnodoc
2770 </a>
2771 </a>
2771 </td><td>
2772 </td><td>
2772 summarize working directory state
2773 summarize working directory state
2773 </td></tr>
2774 </td></tr>
2774 <tr><td>
2775 <tr><td>
2775 <a href="/help/identify">
2776 <a href="/help/identify">
2776 identify
2777 identify
2777 </a>
2778 </a>
2778 </td><td>
2779 </td><td>
2779 identify the working directory or specified revision
2780 identify the working directory or specified revision
2780 </td></tr>
2781 </td></tr>
2781 <tr><td>
2782 <tr><td>
2782 <a href="/help/import">
2783 <a href="/help/import">
2783 import
2784 import
2784 </a>
2785 </a>
2785 </td><td>
2786 </td><td>
2786 import an ordered set of patches
2787 import an ordered set of patches
2787 </td></tr>
2788 </td></tr>
2788 <tr><td>
2789 <tr><td>
2789 <a href="/help/incoming">
2790 <a href="/help/incoming">
2790 incoming
2791 incoming
2791 </a>
2792 </a>
2792 </td><td>
2793 </td><td>
2793 show new changesets found in source
2794 show new changesets found in source
2794 </td></tr>
2795 </td></tr>
2795 <tr><td>
2796 <tr><td>
2796 <a href="/help/manifest">
2797 <a href="/help/manifest">
2797 manifest
2798 manifest
2798 </a>
2799 </a>
2799 </td><td>
2800 </td><td>
2800 output the current or given revision of the project manifest
2801 output the current or given revision of the project manifest
2801 </td></tr>
2802 </td></tr>
2802 <tr><td>
2803 <tr><td>
2803 <a href="/help/nohelp">
2804 <a href="/help/nohelp">
2804 nohelp
2805 nohelp
2805 </a>
2806 </a>
2806 </td><td>
2807 </td><td>
2807 (no help text available)
2808 (no help text available)
2808 </td></tr>
2809 </td></tr>
2809 <tr><td>
2810 <tr><td>
2810 <a href="/help/outgoing">
2811 <a href="/help/outgoing">
2811 outgoing
2812 outgoing
2812 </a>
2813 </a>
2813 </td><td>
2814 </td><td>
2814 show changesets not found in the destination
2815 show changesets not found in the destination
2815 </td></tr>
2816 </td></tr>
2816 <tr><td>
2817 <tr><td>
2817 <a href="/help/paths">
2818 <a href="/help/paths">
2818 paths
2819 paths
2819 </a>
2820 </a>
2820 </td><td>
2821 </td><td>
2821 show aliases for remote repositories
2822 show aliases for remote repositories
2822 </td></tr>
2823 </td></tr>
2823 <tr><td>
2824 <tr><td>
2824 <a href="/help/phase">
2825 <a href="/help/phase">
2825 phase
2826 phase
2826 </a>
2827 </a>
2827 </td><td>
2828 </td><td>
2828 set or show the current phase name
2829 set or show the current phase name
2829 </td></tr>
2830 </td></tr>
2830 <tr><td>
2831 <tr><td>
2831 <a href="/help/purge">
2832 <a href="/help/purge">
2832 purge
2833 purge
2833 </a>
2834 </a>
2834 </td><td>
2835 </td><td>
2835 removes files not tracked by Mercurial
2836 removes files not tracked by Mercurial
2836 </td></tr>
2837 </td></tr>
2837 <tr><td>
2838 <tr><td>
2838 <a href="/help/recover">
2839 <a href="/help/recover">
2839 recover
2840 recover
2840 </a>
2841 </a>
2841 </td><td>
2842 </td><td>
2842 roll back an interrupted transaction
2843 roll back an interrupted transaction
2843 </td></tr>
2844 </td></tr>
2844 <tr><td>
2845 <tr><td>
2845 <a href="/help/rename">
2846 <a href="/help/rename">
2846 rename
2847 rename
2847 </a>
2848 </a>
2848 </td><td>
2849 </td><td>
2849 rename files; equivalent of copy + remove
2850 rename files; equivalent of copy + remove
2850 </td></tr>
2851 </td></tr>
2851 <tr><td>
2852 <tr><td>
2852 <a href="/help/resolve">
2853 <a href="/help/resolve">
2853 resolve
2854 resolve
2854 </a>
2855 </a>
2855 </td><td>
2856 </td><td>
2856 redo merges or set/view the merge status of files
2857 redo merges or set/view the merge status of files
2857 </td></tr>
2858 </td></tr>
2858 <tr><td>
2859 <tr><td>
2859 <a href="/help/revert">
2860 <a href="/help/revert">
2860 revert
2861 revert
2861 </a>
2862 </a>
2862 </td><td>
2863 </td><td>
2863 restore files to their checkout state
2864 restore files to their checkout state
2864 </td></tr>
2865 </td></tr>
2865 <tr><td>
2866 <tr><td>
2866 <a href="/help/root">
2867 <a href="/help/root">
2867 root
2868 root
2868 </a>
2869 </a>
2869 </td><td>
2870 </td><td>
2870 print the root (top) of the current working directory
2871 print the root (top) of the current working directory
2871 </td></tr>
2872 </td></tr>
2872 <tr><td>
2873 <tr><td>
2873 <a href="/help/shellalias">
2874 <a href="/help/shellalias">
2874 shellalias
2875 shellalias
2875 </a>
2876 </a>
2876 </td><td>
2877 </td><td>
2877 (no help text available)
2878 (no help text available)
2878 </td></tr>
2879 </td></tr>
2879 <tr><td>
2880 <tr><td>
2880 <a href="/help/shelve">
2881 <a href="/help/shelve">
2881 shelve
2882 shelve
2882 </a>
2883 </a>
2883 </td><td>
2884 </td><td>
2884 save and set aside changes from the working directory
2885 save and set aside changes from the working directory
2885 </td></tr>
2886 </td></tr>
2886 <tr><td>
2887 <tr><td>
2887 <a href="/help/tag">
2888 <a href="/help/tag">
2888 tag
2889 tag
2889 </a>
2890 </a>
2890 </td><td>
2891 </td><td>
2891 add one or more tags for the current or given revision
2892 add one or more tags for the current or given revision
2892 </td></tr>
2893 </td></tr>
2893 <tr><td>
2894 <tr><td>
2894 <a href="/help/tags">
2895 <a href="/help/tags">
2895 tags
2896 tags
2896 </a>
2897 </a>
2897 </td><td>
2898 </td><td>
2898 list repository tags
2899 list repository tags
2899 </td></tr>
2900 </td></tr>
2900 <tr><td>
2901 <tr><td>
2901 <a href="/help/unbundle">
2902 <a href="/help/unbundle">
2902 unbundle
2903 unbundle
2903 </a>
2904 </a>
2904 </td><td>
2905 </td><td>
2905 apply one or more bundle files
2906 apply one or more bundle files
2906 </td></tr>
2907 </td></tr>
2907 <tr><td>
2908 <tr><td>
2908 <a href="/help/unshelve">
2909 <a href="/help/unshelve">
2909 unshelve
2910 unshelve
2910 </a>
2911 </a>
2911 </td><td>
2912 </td><td>
2912 restore a shelved change to the working directory
2913 restore a shelved change to the working directory
2913 </td></tr>
2914 </td></tr>
2914 <tr><td>
2915 <tr><td>
2915 <a href="/help/verify">
2916 <a href="/help/verify">
2916 verify
2917 verify
2917 </a>
2918 </a>
2918 </td><td>
2919 </td><td>
2919 verify the integrity of the repository
2920 verify the integrity of the repository
2920 </td></tr>
2921 </td></tr>
2921 <tr><td>
2922 <tr><td>
2922 <a href="/help/version">
2923 <a href="/help/version">
2923 version
2924 version
2924 </a>
2925 </a>
2925 </td><td>
2926 </td><td>
2926 output version and copyright information
2927 output version and copyright information
2927 </td></tr>
2928 </td></tr>
2928
2929
2929
2930
2930 </table>
2931 </table>
2931 </div>
2932 </div>
2932 </div>
2933 </div>
2933
2934
2934
2935
2935
2936
2936 </body>
2937 </body>
2937 </html>
2938 </html>
2938
2939
2939
2940
2940 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2941 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2941 200 Script output follows
2942 200 Script output follows
2942
2943
2943 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2944 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2944 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2945 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2945 <head>
2946 <head>
2946 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2947 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2947 <meta name="robots" content="index, nofollow" />
2948 <meta name="robots" content="index, nofollow" />
2948 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2949 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2949 <script type="text/javascript" src="/static/mercurial.js"></script>
2950 <script type="text/javascript" src="/static/mercurial.js"></script>
2950
2951
2951 <title>Help: add</title>
2952 <title>Help: add</title>
2952 </head>
2953 </head>
2953 <body>
2954 <body>
2954
2955
2955 <div class="container">
2956 <div class="container">
2956 <div class="menu">
2957 <div class="menu">
2957 <div class="logo">
2958 <div class="logo">
2958 <a href="https://mercurial-scm.org/">
2959 <a href="https://mercurial-scm.org/">
2959 <img src="/static/hglogo.png" alt="mercurial" /></a>
2960 <img src="/static/hglogo.png" alt="mercurial" /></a>
2960 </div>
2961 </div>
2961 <ul>
2962 <ul>
2962 <li><a href="/shortlog">log</a></li>
2963 <li><a href="/shortlog">log</a></li>
2963 <li><a href="/graph">graph</a></li>
2964 <li><a href="/graph">graph</a></li>
2964 <li><a href="/tags">tags</a></li>
2965 <li><a href="/tags">tags</a></li>
2965 <li><a href="/bookmarks">bookmarks</a></li>
2966 <li><a href="/bookmarks">bookmarks</a></li>
2966 <li><a href="/branches">branches</a></li>
2967 <li><a href="/branches">branches</a></li>
2967 </ul>
2968 </ul>
2968 <ul>
2969 <ul>
2969 <li class="active"><a href="/help">help</a></li>
2970 <li class="active"><a href="/help">help</a></li>
2970 </ul>
2971 </ul>
2971 </div>
2972 </div>
2972
2973
2973 <div class="main">
2974 <div class="main">
2974 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2975 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2975 <h3>Help: add</h3>
2976 <h3>Help: add</h3>
2976
2977
2977 <form class="search" action="/log">
2978 <form class="search" action="/log">
2978
2979
2979 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2980 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2980 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2981 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2981 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2982 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2982 </form>
2983 </form>
2983 <div id="doc">
2984 <div id="doc">
2984 <p>
2985 <p>
2985 hg add [OPTION]... [FILE]...
2986 hg add [OPTION]... [FILE]...
2986 </p>
2987 </p>
2987 <p>
2988 <p>
2988 add the specified files on the next commit
2989 add the specified files on the next commit
2989 </p>
2990 </p>
2990 <p>
2991 <p>
2991 Schedule files to be version controlled and added to the
2992 Schedule files to be version controlled and added to the
2992 repository.
2993 repository.
2993 </p>
2994 </p>
2994 <p>
2995 <p>
2995 The files will be added to the repository at the next commit. To
2996 The files will be added to the repository at the next commit. To
2996 undo an add before that, see 'hg forget'.
2997 undo an add before that, see 'hg forget'.
2997 </p>
2998 </p>
2998 <p>
2999 <p>
2999 If no names are given, add all files to the repository (except
3000 If no names are given, add all files to the repository (except
3000 files matching &quot;.hgignore&quot;).
3001 files matching &quot;.hgignore&quot;).
3001 </p>
3002 </p>
3002 <p>
3003 <p>
3003 Examples:
3004 Examples:
3004 </p>
3005 </p>
3005 <ul>
3006 <ul>
3006 <li> New (unknown) files are added automatically by 'hg add':
3007 <li> New (unknown) files are added automatically by 'hg add':
3007 <pre>
3008 <pre>
3008 \$ ls (re)
3009 \$ ls (re)
3009 foo.c
3010 foo.c
3010 \$ hg status (re)
3011 \$ hg status (re)
3011 ? foo.c
3012 ? foo.c
3012 \$ hg add (re)
3013 \$ hg add (re)
3013 adding foo.c
3014 adding foo.c
3014 \$ hg status (re)
3015 \$ hg status (re)
3015 A foo.c
3016 A foo.c
3016 </pre>
3017 </pre>
3017 <li> Specific files to be added can be specified:
3018 <li> Specific files to be added can be specified:
3018 <pre>
3019 <pre>
3019 \$ ls (re)
3020 \$ ls (re)
3020 bar.c foo.c
3021 bar.c foo.c
3021 \$ hg status (re)
3022 \$ hg status (re)
3022 ? bar.c
3023 ? bar.c
3023 ? foo.c
3024 ? foo.c
3024 \$ hg add bar.c (re)
3025 \$ hg add bar.c (re)
3025 \$ hg status (re)
3026 \$ hg status (re)
3026 A bar.c
3027 A bar.c
3027 ? foo.c
3028 ? foo.c
3028 </pre>
3029 </pre>
3029 </ul>
3030 </ul>
3030 <p>
3031 <p>
3031 Returns 0 if all files are successfully added.
3032 Returns 0 if all files are successfully added.
3032 </p>
3033 </p>
3033 <p>
3034 <p>
3034 options ([+] can be repeated):
3035 options ([+] can be repeated):
3035 </p>
3036 </p>
3036 <table>
3037 <table>
3037 <tr><td>-I</td>
3038 <tr><td>-I</td>
3038 <td>--include PATTERN [+]</td>
3039 <td>--include PATTERN [+]</td>
3039 <td>include names matching the given patterns</td></tr>
3040 <td>include names matching the given patterns</td></tr>
3040 <tr><td>-X</td>
3041 <tr><td>-X</td>
3041 <td>--exclude PATTERN [+]</td>
3042 <td>--exclude PATTERN [+]</td>
3042 <td>exclude names matching the given patterns</td></tr>
3043 <td>exclude names matching the given patterns</td></tr>
3043 <tr><td>-S</td>
3044 <tr><td>-S</td>
3044 <td>--subrepos</td>
3045 <td>--subrepos</td>
3045 <td>recurse into subrepositories</td></tr>
3046 <td>recurse into subrepositories</td></tr>
3046 <tr><td>-n</td>
3047 <tr><td>-n</td>
3047 <td>--dry-run</td>
3048 <td>--dry-run</td>
3048 <td>do not perform actions, just print output</td></tr>
3049 <td>do not perform actions, just print output</td></tr>
3049 </table>
3050 </table>
3050 <p>
3051 <p>
3051 global options ([+] can be repeated):
3052 global options ([+] can be repeated):
3052 </p>
3053 </p>
3053 <table>
3054 <table>
3054 <tr><td>-R</td>
3055 <tr><td>-R</td>
3055 <td>--repository REPO</td>
3056 <td>--repository REPO</td>
3056 <td>repository root directory or name of overlay bundle file</td></tr>
3057 <td>repository root directory or name of overlay bundle file</td></tr>
3057 <tr><td></td>
3058 <tr><td></td>
3058 <td>--cwd DIR</td>
3059 <td>--cwd DIR</td>
3059 <td>change working directory</td></tr>
3060 <td>change working directory</td></tr>
3060 <tr><td>-y</td>
3061 <tr><td>-y</td>
3061 <td>--noninteractive</td>
3062 <td>--noninteractive</td>
3062 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3063 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3063 <tr><td>-q</td>
3064 <tr><td>-q</td>
3064 <td>--quiet</td>
3065 <td>--quiet</td>
3065 <td>suppress output</td></tr>
3066 <td>suppress output</td></tr>
3066 <tr><td>-v</td>
3067 <tr><td>-v</td>
3067 <td>--verbose</td>
3068 <td>--verbose</td>
3068 <td>enable additional output</td></tr>
3069 <td>enable additional output</td></tr>
3069 <tr><td></td>
3070 <tr><td></td>
3070 <td>--color TYPE</td>
3071 <td>--color TYPE</td>
3071 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3072 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3072 <tr><td></td>
3073 <tr><td></td>
3073 <td>--config CONFIG [+]</td>
3074 <td>--config CONFIG [+]</td>
3074 <td>set/override config option (use 'section.name=value')</td></tr>
3075 <td>set/override config option (use 'section.name=value')</td></tr>
3075 <tr><td></td>
3076 <tr><td></td>
3076 <td>--debug</td>
3077 <td>--debug</td>
3077 <td>enable debugging output</td></tr>
3078 <td>enable debugging output</td></tr>
3078 <tr><td></td>
3079 <tr><td></td>
3079 <td>--debugger</td>
3080 <td>--debugger</td>
3080 <td>start debugger</td></tr>
3081 <td>start debugger</td></tr>
3081 <tr><td></td>
3082 <tr><td></td>
3082 <td>--encoding ENCODE</td>
3083 <td>--encoding ENCODE</td>
3083 <td>set the charset encoding (default: ascii)</td></tr>
3084 <td>set the charset encoding (default: ascii)</td></tr>
3084 <tr><td></td>
3085 <tr><td></td>
3085 <td>--encodingmode MODE</td>
3086 <td>--encodingmode MODE</td>
3086 <td>set the charset encoding mode (default: strict)</td></tr>
3087 <td>set the charset encoding mode (default: strict)</td></tr>
3087 <tr><td></td>
3088 <tr><td></td>
3088 <td>--traceback</td>
3089 <td>--traceback</td>
3089 <td>always print a traceback on exception</td></tr>
3090 <td>always print a traceback on exception</td></tr>
3090 <tr><td></td>
3091 <tr><td></td>
3091 <td>--time</td>
3092 <td>--time</td>
3092 <td>time how long the command takes</td></tr>
3093 <td>time how long the command takes</td></tr>
3093 <tr><td></td>
3094 <tr><td></td>
3094 <td>--profile</td>
3095 <td>--profile</td>
3095 <td>print command execution profile</td></tr>
3096 <td>print command execution profile</td></tr>
3096 <tr><td></td>
3097 <tr><td></td>
3097 <td>--version</td>
3098 <td>--version</td>
3098 <td>output version information and exit</td></tr>
3099 <td>output version information and exit</td></tr>
3099 <tr><td>-h</td>
3100 <tr><td>-h</td>
3100 <td>--help</td>
3101 <td>--help</td>
3101 <td>display help and exit</td></tr>
3102 <td>display help and exit</td></tr>
3102 <tr><td></td>
3103 <tr><td></td>
3103 <td>--hidden</td>
3104 <td>--hidden</td>
3104 <td>consider hidden changesets</td></tr>
3105 <td>consider hidden changesets</td></tr>
3105 <tr><td></td>
3106 <tr><td></td>
3106 <td>--pager TYPE</td>
3107 <td>--pager TYPE</td>
3107 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3108 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3108 </table>
3109 </table>
3109
3110
3110 </div>
3111 </div>
3111 </div>
3112 </div>
3112 </div>
3113 </div>
3113
3114
3114
3115
3115
3116
3116 </body>
3117 </body>
3117 </html>
3118 </html>
3118
3119
3119
3120
3120 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
3121 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
3121 200 Script output follows
3122 200 Script output follows
3122
3123
3123 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3124 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3124 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3125 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3125 <head>
3126 <head>
3126 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3127 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3127 <meta name="robots" content="index, nofollow" />
3128 <meta name="robots" content="index, nofollow" />
3128 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3129 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3129 <script type="text/javascript" src="/static/mercurial.js"></script>
3130 <script type="text/javascript" src="/static/mercurial.js"></script>
3130
3131
3131 <title>Help: remove</title>
3132 <title>Help: remove</title>
3132 </head>
3133 </head>
3133 <body>
3134 <body>
3134
3135
3135 <div class="container">
3136 <div class="container">
3136 <div class="menu">
3137 <div class="menu">
3137 <div class="logo">
3138 <div class="logo">
3138 <a href="https://mercurial-scm.org/">
3139 <a href="https://mercurial-scm.org/">
3139 <img src="/static/hglogo.png" alt="mercurial" /></a>
3140 <img src="/static/hglogo.png" alt="mercurial" /></a>
3140 </div>
3141 </div>
3141 <ul>
3142 <ul>
3142 <li><a href="/shortlog">log</a></li>
3143 <li><a href="/shortlog">log</a></li>
3143 <li><a href="/graph">graph</a></li>
3144 <li><a href="/graph">graph</a></li>
3144 <li><a href="/tags">tags</a></li>
3145 <li><a href="/tags">tags</a></li>
3145 <li><a href="/bookmarks">bookmarks</a></li>
3146 <li><a href="/bookmarks">bookmarks</a></li>
3146 <li><a href="/branches">branches</a></li>
3147 <li><a href="/branches">branches</a></li>
3147 </ul>
3148 </ul>
3148 <ul>
3149 <ul>
3149 <li class="active"><a href="/help">help</a></li>
3150 <li class="active"><a href="/help">help</a></li>
3150 </ul>
3151 </ul>
3151 </div>
3152 </div>
3152
3153
3153 <div class="main">
3154 <div class="main">
3154 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3155 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3155 <h3>Help: remove</h3>
3156 <h3>Help: remove</h3>
3156
3157
3157 <form class="search" action="/log">
3158 <form class="search" action="/log">
3158
3159
3159 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3160 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3160 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3161 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3161 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3162 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3162 </form>
3163 </form>
3163 <div id="doc">
3164 <div id="doc">
3164 <p>
3165 <p>
3165 hg remove [OPTION]... FILE...
3166 hg remove [OPTION]... FILE...
3166 </p>
3167 </p>
3167 <p>
3168 <p>
3168 aliases: rm
3169 aliases: rm
3169 </p>
3170 </p>
3170 <p>
3171 <p>
3171 remove the specified files on the next commit
3172 remove the specified files on the next commit
3172 </p>
3173 </p>
3173 <p>
3174 <p>
3174 Schedule the indicated files for removal from the current branch.
3175 Schedule the indicated files for removal from the current branch.
3175 </p>
3176 </p>
3176 <p>
3177 <p>
3177 This command schedules the files to be removed at the next commit.
3178 This command schedules the files to be removed at the next commit.
3178 To undo a remove before that, see 'hg revert'. To undo added
3179 To undo a remove before that, see 'hg revert'. To undo added
3179 files, see 'hg forget'.
3180 files, see 'hg forget'.
3180 </p>
3181 </p>
3181 <p>
3182 <p>
3182 -A/--after can be used to remove only files that have already
3183 -A/--after can be used to remove only files that have already
3183 been deleted, -f/--force can be used to force deletion, and -Af
3184 been deleted, -f/--force can be used to force deletion, and -Af
3184 can be used to remove files from the next revision without
3185 can be used to remove files from the next revision without
3185 deleting them from the working directory.
3186 deleting them from the working directory.
3186 </p>
3187 </p>
3187 <p>
3188 <p>
3188 The following table details the behavior of remove for different
3189 The following table details the behavior of remove for different
3189 file states (columns) and option combinations (rows). The file
3190 file states (columns) and option combinations (rows). The file
3190 states are Added [A], Clean [C], Modified [M] and Missing [!]
3191 states are Added [A], Clean [C], Modified [M] and Missing [!]
3191 (as reported by 'hg status'). The actions are Warn, Remove
3192 (as reported by 'hg status'). The actions are Warn, Remove
3192 (from branch) and Delete (from disk):
3193 (from branch) and Delete (from disk):
3193 </p>
3194 </p>
3194 <table>
3195 <table>
3195 <tr><td>opt/state</td>
3196 <tr><td>opt/state</td>
3196 <td>A</td>
3197 <td>A</td>
3197 <td>C</td>
3198 <td>C</td>
3198 <td>M</td>
3199 <td>M</td>
3199 <td>!</td></tr>
3200 <td>!</td></tr>
3200 <tr><td>none</td>
3201 <tr><td>none</td>
3201 <td>W</td>
3202 <td>W</td>
3202 <td>RD</td>
3203 <td>RD</td>
3203 <td>W</td>
3204 <td>W</td>
3204 <td>R</td></tr>
3205 <td>R</td></tr>
3205 <tr><td>-f</td>
3206 <tr><td>-f</td>
3206 <td>R</td>
3207 <td>R</td>
3207 <td>RD</td>
3208 <td>RD</td>
3208 <td>RD</td>
3209 <td>RD</td>
3209 <td>R</td></tr>
3210 <td>R</td></tr>
3210 <tr><td>-A</td>
3211 <tr><td>-A</td>
3211 <td>W</td>
3212 <td>W</td>
3212 <td>W</td>
3213 <td>W</td>
3213 <td>W</td>
3214 <td>W</td>
3214 <td>R</td></tr>
3215 <td>R</td></tr>
3215 <tr><td>-Af</td>
3216 <tr><td>-Af</td>
3216 <td>R</td>
3217 <td>R</td>
3217 <td>R</td>
3218 <td>R</td>
3218 <td>R</td>
3219 <td>R</td>
3219 <td>R</td></tr>
3220 <td>R</td></tr>
3220 </table>
3221 </table>
3221 <p>
3222 <p>
3222 <b>Note:</b>
3223 <b>Note:</b>
3223 </p>
3224 </p>
3224 <p>
3225 <p>
3225 'hg remove' never deletes files in Added [A] state from the
3226 'hg remove' never deletes files in Added [A] state from the
3226 working directory, not even if &quot;--force&quot; is specified.
3227 working directory, not even if &quot;--force&quot; is specified.
3227 </p>
3228 </p>
3228 <p>
3229 <p>
3229 Returns 0 on success, 1 if any warnings encountered.
3230 Returns 0 on success, 1 if any warnings encountered.
3230 </p>
3231 </p>
3231 <p>
3232 <p>
3232 options ([+] can be repeated):
3233 options ([+] can be repeated):
3233 </p>
3234 </p>
3234 <table>
3235 <table>
3235 <tr><td>-A</td>
3236 <tr><td>-A</td>
3236 <td>--after</td>
3237 <td>--after</td>
3237 <td>record delete for missing files</td></tr>
3238 <td>record delete for missing files</td></tr>
3238 <tr><td>-f</td>
3239 <tr><td>-f</td>
3239 <td>--force</td>
3240 <td>--force</td>
3240 <td>forget added files, delete modified files</td></tr>
3241 <td>forget added files, delete modified files</td></tr>
3241 <tr><td>-S</td>
3242 <tr><td>-S</td>
3242 <td>--subrepos</td>
3243 <td>--subrepos</td>
3243 <td>recurse into subrepositories</td></tr>
3244 <td>recurse into subrepositories</td></tr>
3244 <tr><td>-I</td>
3245 <tr><td>-I</td>
3245 <td>--include PATTERN [+]</td>
3246 <td>--include PATTERN [+]</td>
3246 <td>include names matching the given patterns</td></tr>
3247 <td>include names matching the given patterns</td></tr>
3247 <tr><td>-X</td>
3248 <tr><td>-X</td>
3248 <td>--exclude PATTERN [+]</td>
3249 <td>--exclude PATTERN [+]</td>
3249 <td>exclude names matching the given patterns</td></tr>
3250 <td>exclude names matching the given patterns</td></tr>
3250 <tr><td>-n</td>
3251 <tr><td>-n</td>
3251 <td>--dry-run</td>
3252 <td>--dry-run</td>
3252 <td>do not perform actions, just print output</td></tr>
3253 <td>do not perform actions, just print output</td></tr>
3253 </table>
3254 </table>
3254 <p>
3255 <p>
3255 global options ([+] can be repeated):
3256 global options ([+] can be repeated):
3256 </p>
3257 </p>
3257 <table>
3258 <table>
3258 <tr><td>-R</td>
3259 <tr><td>-R</td>
3259 <td>--repository REPO</td>
3260 <td>--repository REPO</td>
3260 <td>repository root directory or name of overlay bundle file</td></tr>
3261 <td>repository root directory or name of overlay bundle file</td></tr>
3261 <tr><td></td>
3262 <tr><td></td>
3262 <td>--cwd DIR</td>
3263 <td>--cwd DIR</td>
3263 <td>change working directory</td></tr>
3264 <td>change working directory</td></tr>
3264 <tr><td>-y</td>
3265 <tr><td>-y</td>
3265 <td>--noninteractive</td>
3266 <td>--noninteractive</td>
3266 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3267 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3267 <tr><td>-q</td>
3268 <tr><td>-q</td>
3268 <td>--quiet</td>
3269 <td>--quiet</td>
3269 <td>suppress output</td></tr>
3270 <td>suppress output</td></tr>
3270 <tr><td>-v</td>
3271 <tr><td>-v</td>
3271 <td>--verbose</td>
3272 <td>--verbose</td>
3272 <td>enable additional output</td></tr>
3273 <td>enable additional output</td></tr>
3273 <tr><td></td>
3274 <tr><td></td>
3274 <td>--color TYPE</td>
3275 <td>--color TYPE</td>
3275 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3276 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3276 <tr><td></td>
3277 <tr><td></td>
3277 <td>--config CONFIG [+]</td>
3278 <td>--config CONFIG [+]</td>
3278 <td>set/override config option (use 'section.name=value')</td></tr>
3279 <td>set/override config option (use 'section.name=value')</td></tr>
3279 <tr><td></td>
3280 <tr><td></td>
3280 <td>--debug</td>
3281 <td>--debug</td>
3281 <td>enable debugging output</td></tr>
3282 <td>enable debugging output</td></tr>
3282 <tr><td></td>
3283 <tr><td></td>
3283 <td>--debugger</td>
3284 <td>--debugger</td>
3284 <td>start debugger</td></tr>
3285 <td>start debugger</td></tr>
3285 <tr><td></td>
3286 <tr><td></td>
3286 <td>--encoding ENCODE</td>
3287 <td>--encoding ENCODE</td>
3287 <td>set the charset encoding (default: ascii)</td></tr>
3288 <td>set the charset encoding (default: ascii)</td></tr>
3288 <tr><td></td>
3289 <tr><td></td>
3289 <td>--encodingmode MODE</td>
3290 <td>--encodingmode MODE</td>
3290 <td>set the charset encoding mode (default: strict)</td></tr>
3291 <td>set the charset encoding mode (default: strict)</td></tr>
3291 <tr><td></td>
3292 <tr><td></td>
3292 <td>--traceback</td>
3293 <td>--traceback</td>
3293 <td>always print a traceback on exception</td></tr>
3294 <td>always print a traceback on exception</td></tr>
3294 <tr><td></td>
3295 <tr><td></td>
3295 <td>--time</td>
3296 <td>--time</td>
3296 <td>time how long the command takes</td></tr>
3297 <td>time how long the command takes</td></tr>
3297 <tr><td></td>
3298 <tr><td></td>
3298 <td>--profile</td>
3299 <td>--profile</td>
3299 <td>print command execution profile</td></tr>
3300 <td>print command execution profile</td></tr>
3300 <tr><td></td>
3301 <tr><td></td>
3301 <td>--version</td>
3302 <td>--version</td>
3302 <td>output version information and exit</td></tr>
3303 <td>output version information and exit</td></tr>
3303 <tr><td>-h</td>
3304 <tr><td>-h</td>
3304 <td>--help</td>
3305 <td>--help</td>
3305 <td>display help and exit</td></tr>
3306 <td>display help and exit</td></tr>
3306 <tr><td></td>
3307 <tr><td></td>
3307 <td>--hidden</td>
3308 <td>--hidden</td>
3308 <td>consider hidden changesets</td></tr>
3309 <td>consider hidden changesets</td></tr>
3309 <tr><td></td>
3310 <tr><td></td>
3310 <td>--pager TYPE</td>
3311 <td>--pager TYPE</td>
3311 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3312 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3312 </table>
3313 </table>
3313
3314
3314 </div>
3315 </div>
3315 </div>
3316 </div>
3316 </div>
3317 </div>
3317
3318
3318
3319
3319
3320
3320 </body>
3321 </body>
3321 </html>
3322 </html>
3322
3323
3323
3324
3324 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
3325 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
3325 200 Script output follows
3326 200 Script output follows
3326
3327
3327 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3328 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3328 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3329 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3329 <head>
3330 <head>
3330 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3331 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3331 <meta name="robots" content="index, nofollow" />
3332 <meta name="robots" content="index, nofollow" />
3332 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3333 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3333 <script type="text/javascript" src="/static/mercurial.js"></script>
3334 <script type="text/javascript" src="/static/mercurial.js"></script>
3334
3335
3335 <title>Help: dates</title>
3336 <title>Help: dates</title>
3336 </head>
3337 </head>
3337 <body>
3338 <body>
3338
3339
3339 <div class="container">
3340 <div class="container">
3340 <div class="menu">
3341 <div class="menu">
3341 <div class="logo">
3342 <div class="logo">
3342 <a href="https://mercurial-scm.org/">
3343 <a href="https://mercurial-scm.org/">
3343 <img src="/static/hglogo.png" alt="mercurial" /></a>
3344 <img src="/static/hglogo.png" alt="mercurial" /></a>
3344 </div>
3345 </div>
3345 <ul>
3346 <ul>
3346 <li><a href="/shortlog">log</a></li>
3347 <li><a href="/shortlog">log</a></li>
3347 <li><a href="/graph">graph</a></li>
3348 <li><a href="/graph">graph</a></li>
3348 <li><a href="/tags">tags</a></li>
3349 <li><a href="/tags">tags</a></li>
3349 <li><a href="/bookmarks">bookmarks</a></li>
3350 <li><a href="/bookmarks">bookmarks</a></li>
3350 <li><a href="/branches">branches</a></li>
3351 <li><a href="/branches">branches</a></li>
3351 </ul>
3352 </ul>
3352 <ul>
3353 <ul>
3353 <li class="active"><a href="/help">help</a></li>
3354 <li class="active"><a href="/help">help</a></li>
3354 </ul>
3355 </ul>
3355 </div>
3356 </div>
3356
3357
3357 <div class="main">
3358 <div class="main">
3358 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3359 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3359 <h3>Help: dates</h3>
3360 <h3>Help: dates</h3>
3360
3361
3361 <form class="search" action="/log">
3362 <form class="search" action="/log">
3362
3363
3363 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3364 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3364 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3365 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3365 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3366 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3366 </form>
3367 </form>
3367 <div id="doc">
3368 <div id="doc">
3368 <h1>Date Formats</h1>
3369 <h1>Date Formats</h1>
3369 <p>
3370 <p>
3370 Some commands allow the user to specify a date, e.g.:
3371 Some commands allow the user to specify a date, e.g.:
3371 </p>
3372 </p>
3372 <ul>
3373 <ul>
3373 <li> backout, commit, import, tag: Specify the commit date.
3374 <li> backout, commit, import, tag: Specify the commit date.
3374 <li> log, revert, update: Select revision(s) by date.
3375 <li> log, revert, update: Select revision(s) by date.
3375 </ul>
3376 </ul>
3376 <p>
3377 <p>
3377 Many date formats are valid. Here are some examples:
3378 Many date formats are valid. Here are some examples:
3378 </p>
3379 </p>
3379 <ul>
3380 <ul>
3380 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
3381 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
3381 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
3382 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
3382 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
3383 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
3383 <li> &quot;Dec 6&quot; (midnight)
3384 <li> &quot;Dec 6&quot; (midnight)
3384 <li> &quot;13:18&quot; (today assumed)
3385 <li> &quot;13:18&quot; (today assumed)
3385 <li> &quot;3:39&quot; (3:39AM assumed)
3386 <li> &quot;3:39&quot; (3:39AM assumed)
3386 <li> &quot;3:39pm&quot; (15:39)
3387 <li> &quot;3:39pm&quot; (15:39)
3387 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
3388 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
3388 <li> &quot;2006-12-6 13:18&quot;
3389 <li> &quot;2006-12-6 13:18&quot;
3389 <li> &quot;2006-12-6&quot;
3390 <li> &quot;2006-12-6&quot;
3390 <li> &quot;12-6&quot;
3391 <li> &quot;12-6&quot;
3391 <li> &quot;12/6&quot;
3392 <li> &quot;12/6&quot;
3392 <li> &quot;12/6/6&quot; (Dec 6 2006)
3393 <li> &quot;12/6/6&quot; (Dec 6 2006)
3393 <li> &quot;today&quot; (midnight)
3394 <li> &quot;today&quot; (midnight)
3394 <li> &quot;yesterday&quot; (midnight)
3395 <li> &quot;yesterday&quot; (midnight)
3395 <li> &quot;now&quot; - right now
3396 <li> &quot;now&quot; - right now
3396 </ul>
3397 </ul>
3397 <p>
3398 <p>
3398 Lastly, there is Mercurial's internal format:
3399 Lastly, there is Mercurial's internal format:
3399 </p>
3400 </p>
3400 <ul>
3401 <ul>
3401 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3402 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3402 </ul>
3403 </ul>
3403 <p>
3404 <p>
3404 This is the internal representation format for dates. The first number
3405 This is the internal representation format for dates. The first number
3405 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3406 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3406 second is the offset of the local timezone, in seconds west of UTC
3407 second is the offset of the local timezone, in seconds west of UTC
3407 (negative if the timezone is east of UTC).
3408 (negative if the timezone is east of UTC).
3408 </p>
3409 </p>
3409 <p>
3410 <p>
3410 The log command also accepts date ranges:
3411 The log command also accepts date ranges:
3411 </p>
3412 </p>
3412 <ul>
3413 <ul>
3413 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3414 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3414 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3415 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3415 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3416 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3416 <li> &quot;-DAYS&quot; - within a given number of days from today
3417 <li> &quot;-DAYS&quot; - within a given number of days from today
3417 </ul>
3418 </ul>
3418
3419
3419 </div>
3420 </div>
3420 </div>
3421 </div>
3421 </div>
3422 </div>
3422
3423
3423
3424
3424
3425
3425 </body>
3426 </body>
3426 </html>
3427 </html>
3427
3428
3428
3429
3429 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3430 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3430 200 Script output follows
3431 200 Script output follows
3431
3432
3432 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3433 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3433 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3434 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3434 <head>
3435 <head>
3435 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3436 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3436 <meta name="robots" content="index, nofollow" />
3437 <meta name="robots" content="index, nofollow" />
3437 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3438 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3438 <script type="text/javascript" src="/static/mercurial.js"></script>
3439 <script type="text/javascript" src="/static/mercurial.js"></script>
3439
3440
3440 <title>Help: pager</title>
3441 <title>Help: pager</title>
3441 </head>
3442 </head>
3442 <body>
3443 <body>
3443
3444
3444 <div class="container">
3445 <div class="container">
3445 <div class="menu">
3446 <div class="menu">
3446 <div class="logo">
3447 <div class="logo">
3447 <a href="https://mercurial-scm.org/">
3448 <a href="https://mercurial-scm.org/">
3448 <img src="/static/hglogo.png" alt="mercurial" /></a>
3449 <img src="/static/hglogo.png" alt="mercurial" /></a>
3449 </div>
3450 </div>
3450 <ul>
3451 <ul>
3451 <li><a href="/shortlog">log</a></li>
3452 <li><a href="/shortlog">log</a></li>
3452 <li><a href="/graph">graph</a></li>
3453 <li><a href="/graph">graph</a></li>
3453 <li><a href="/tags">tags</a></li>
3454 <li><a href="/tags">tags</a></li>
3454 <li><a href="/bookmarks">bookmarks</a></li>
3455 <li><a href="/bookmarks">bookmarks</a></li>
3455 <li><a href="/branches">branches</a></li>
3456 <li><a href="/branches">branches</a></li>
3456 </ul>
3457 </ul>
3457 <ul>
3458 <ul>
3458 <li class="active"><a href="/help">help</a></li>
3459 <li class="active"><a href="/help">help</a></li>
3459 </ul>
3460 </ul>
3460 </div>
3461 </div>
3461
3462
3462 <div class="main">
3463 <div class="main">
3463 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3464 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3464 <h3>Help: pager</h3>
3465 <h3>Help: pager</h3>
3465
3466
3466 <form class="search" action="/log">
3467 <form class="search" action="/log">
3467
3468
3468 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3469 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3469 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3470 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3470 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3471 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3471 </form>
3472 </form>
3472 <div id="doc">
3473 <div id="doc">
3473 <h1>Pager Support</h1>
3474 <h1>Pager Support</h1>
3474 <p>
3475 <p>
3475 Some Mercurial commands can produce a lot of output, and Mercurial will
3476 Some Mercurial commands can produce a lot of output, and Mercurial will
3476 attempt to use a pager to make those commands more pleasant.
3477 attempt to use a pager to make those commands more pleasant.
3477 </p>
3478 </p>
3478 <p>
3479 <p>
3479 To set the pager that should be used, set the application variable:
3480 To set the pager that should be used, set the application variable:
3480 </p>
3481 </p>
3481 <pre>
3482 <pre>
3482 [pager]
3483 [pager]
3483 pager = less -FRX
3484 pager = less -FRX
3484 </pre>
3485 </pre>
3485 <p>
3486 <p>
3486 If no pager is set in the user or repository configuration, Mercurial uses the
3487 If no pager is set in the user or repository configuration, Mercurial uses the
3487 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3488 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3488 or system configuration is used. If none of these are set, a default pager will
3489 or system configuration is used. If none of these are set, a default pager will
3489 be used, typically 'less' on Unix and 'more' on Windows.
3490 be used, typically 'less' on Unix and 'more' on Windows.
3490 </p>
3491 </p>
3491 <p>
3492 <p>
3492 You can disable the pager for certain commands by adding them to the
3493 You can disable the pager for certain commands by adding them to the
3493 pager.ignore list:
3494 pager.ignore list:
3494 </p>
3495 </p>
3495 <pre>
3496 <pre>
3496 [pager]
3497 [pager]
3497 ignore = version, help, update
3498 ignore = version, help, update
3498 </pre>
3499 </pre>
3499 <p>
3500 <p>
3500 To ignore global commands like 'hg version' or 'hg help', you have
3501 To ignore global commands like 'hg version' or 'hg help', you have
3501 to specify them in your user configuration file.
3502 to specify them in your user configuration file.
3502 </p>
3503 </p>
3503 <p>
3504 <p>
3504 To control whether the pager is used at all for an individual command,
3505 To control whether the pager is used at all for an individual command,
3505 you can use --pager=&lt;value&gt;:
3506 you can use --pager=&lt;value&gt;:
3506 </p>
3507 </p>
3507 <ul>
3508 <ul>
3508 <li> use as needed: 'auto'.
3509 <li> use as needed: 'auto'.
3509 <li> require the pager: 'yes' or 'on'.
3510 <li> require the pager: 'yes' or 'on'.
3510 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3511 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3511 </ul>
3512 </ul>
3512 <p>
3513 <p>
3513 To globally turn off all attempts to use a pager, set:
3514 To globally turn off all attempts to use a pager, set:
3514 </p>
3515 </p>
3515 <pre>
3516 <pre>
3516 [ui]
3517 [ui]
3517 paginate = never
3518 paginate = never
3518 </pre>
3519 </pre>
3519 <p>
3520 <p>
3520 which will prevent the pager from running.
3521 which will prevent the pager from running.
3521 </p>
3522 </p>
3522
3523
3523 </div>
3524 </div>
3524 </div>
3525 </div>
3525 </div>
3526 </div>
3526
3527
3527
3528
3528
3529
3529 </body>
3530 </body>
3530 </html>
3531 </html>
3531
3532
3532
3533
3533 Sub-topic indexes rendered properly
3534 Sub-topic indexes rendered properly
3534
3535
3535 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3536 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3536 200 Script output follows
3537 200 Script output follows
3537
3538
3538 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3539 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3539 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3540 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3540 <head>
3541 <head>
3541 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3542 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3542 <meta name="robots" content="index, nofollow" />
3543 <meta name="robots" content="index, nofollow" />
3543 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3544 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3544 <script type="text/javascript" src="/static/mercurial.js"></script>
3545 <script type="text/javascript" src="/static/mercurial.js"></script>
3545
3546
3546 <title>Help: internals</title>
3547 <title>Help: internals</title>
3547 </head>
3548 </head>
3548 <body>
3549 <body>
3549
3550
3550 <div class="container">
3551 <div class="container">
3551 <div class="menu">
3552 <div class="menu">
3552 <div class="logo">
3553 <div class="logo">
3553 <a href="https://mercurial-scm.org/">
3554 <a href="https://mercurial-scm.org/">
3554 <img src="/static/hglogo.png" alt="mercurial" /></a>
3555 <img src="/static/hglogo.png" alt="mercurial" /></a>
3555 </div>
3556 </div>
3556 <ul>
3557 <ul>
3557 <li><a href="/shortlog">log</a></li>
3558 <li><a href="/shortlog">log</a></li>
3558 <li><a href="/graph">graph</a></li>
3559 <li><a href="/graph">graph</a></li>
3559 <li><a href="/tags">tags</a></li>
3560 <li><a href="/tags">tags</a></li>
3560 <li><a href="/bookmarks">bookmarks</a></li>
3561 <li><a href="/bookmarks">bookmarks</a></li>
3561 <li><a href="/branches">branches</a></li>
3562 <li><a href="/branches">branches</a></li>
3562 </ul>
3563 </ul>
3563 <ul>
3564 <ul>
3564 <li><a href="/help">help</a></li>
3565 <li><a href="/help">help</a></li>
3565 </ul>
3566 </ul>
3566 </div>
3567 </div>
3567
3568
3568 <div class="main">
3569 <div class="main">
3569 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3570 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3570
3571
3571 <form class="search" action="/log">
3572 <form class="search" action="/log">
3572
3573
3573 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3574 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3574 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3575 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3575 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3576 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3576 </form>
3577 </form>
3577 <table class="bigtable">
3578 <table class="bigtable">
3578 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3579 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3579
3580
3580 <tr><td>
3581 <tr><td>
3581 <a href="/help/internals.bid-merge">
3582 <a href="/help/internals.bid-merge">
3582 bid-merge
3583 bid-merge
3583 </a>
3584 </a>
3584 </td><td>
3585 </td><td>
3585 Bid Merge Algorithm
3586 Bid Merge Algorithm
3586 </td></tr>
3587 </td></tr>
3587 <tr><td>
3588 <tr><td>
3588 <a href="/help/internals.bundle2">
3589 <a href="/help/internals.bundle2">
3589 bundle2
3590 bundle2
3590 </a>
3591 </a>
3591 </td><td>
3592 </td><td>
3592 Bundle2
3593 Bundle2
3593 </td></tr>
3594 </td></tr>
3594 <tr><td>
3595 <tr><td>
3595 <a href="/help/internals.bundles">
3596 <a href="/help/internals.bundles">
3596 bundles
3597 bundles
3597 </a>
3598 </a>
3598 </td><td>
3599 </td><td>
3599 Bundles
3600 Bundles
3600 </td></tr>
3601 </td></tr>
3601 <tr><td>
3602 <tr><td>
3602 <a href="/help/internals.cbor">
3603 <a href="/help/internals.cbor">
3603 cbor
3604 cbor
3604 </a>
3605 </a>
3605 </td><td>
3606 </td><td>
3606 CBOR
3607 CBOR
3607 </td></tr>
3608 </td></tr>
3608 <tr><td>
3609 <tr><td>
3609 <a href="/help/internals.censor">
3610 <a href="/help/internals.censor">
3610 censor
3611 censor
3611 </a>
3612 </a>
3612 </td><td>
3613 </td><td>
3613 Censor
3614 Censor
3614 </td></tr>
3615 </td></tr>
3615 <tr><td>
3616 <tr><td>
3616 <a href="/help/internals.changegroups">
3617 <a href="/help/internals.changegroups">
3617 changegroups
3618 changegroups
3618 </a>
3619 </a>
3619 </td><td>
3620 </td><td>
3620 Changegroups
3621 Changegroups
3621 </td></tr>
3622 </td></tr>
3622 <tr><td>
3623 <tr><td>
3623 <a href="/help/internals.config">
3624 <a href="/help/internals.config">
3624 config
3625 config
3625 </a>
3626 </a>
3626 </td><td>
3627 </td><td>
3627 Config Registrar
3628 Config Registrar
3628 </td></tr>
3629 </td></tr>
3629 <tr><td>
3630 <tr><td>
3630 <a href="/help/internals.dirstate-v2">
3631 <a href="/help/internals.dirstate-v2">
3631 dirstate-v2
3632 dirstate-v2
3632 </a>
3633 </a>
3633 </td><td>
3634 </td><td>
3634 dirstate-v2 file format
3635 dirstate-v2 file format
3635 </td></tr>
3636 </td></tr>
3636 <tr><td>
3637 <tr><td>
3637 <a href="/help/internals.extensions">
3638 <a href="/help/internals.extensions">
3638 extensions
3639 extensions
3639 </a>
3640 </a>
3640 </td><td>
3641 </td><td>
3641 Extension API
3642 Extension API
3642 </td></tr>
3643 </td></tr>
3643 <tr><td>
3644 <tr><td>
3644 <a href="/help/internals.mergestate">
3645 <a href="/help/internals.mergestate">
3645 mergestate
3646 mergestate
3646 </a>
3647 </a>
3647 </td><td>
3648 </td><td>
3648 Mergestate
3649 Mergestate
3649 </td></tr>
3650 </td></tr>
3650 <tr><td>
3651 <tr><td>
3651 <a href="/help/internals.requirements">
3652 <a href="/help/internals.requirements">
3652 requirements
3653 requirements
3653 </a>
3654 </a>
3654 </td><td>
3655 </td><td>
3655 Repository Requirements
3656 Repository Requirements
3656 </td></tr>
3657 </td></tr>
3657 <tr><td>
3658 <tr><td>
3658 <a href="/help/internals.revlogs">
3659 <a href="/help/internals.revlogs">
3659 revlogs
3660 revlogs
3660 </a>
3661 </a>
3661 </td><td>
3662 </td><td>
3662 Revision Logs
3663 Revision Logs
3663 </td></tr>
3664 </td></tr>
3664 <tr><td>
3665 <tr><td>
3665 <a href="/help/internals.wireprotocol">
3666 <a href="/help/internals.wireprotocol">
3666 wireprotocol
3667 wireprotocol
3667 </a>
3668 </a>
3668 </td><td>
3669 </td><td>
3669 Wire Protocol
3670 Wire Protocol
3670 </td></tr>
3671 </td></tr>
3671 <tr><td>
3672 <tr><td>
3672 <a href="/help/internals.wireprotocolrpc">
3673 <a href="/help/internals.wireprotocolrpc">
3673 wireprotocolrpc
3674 wireprotocolrpc
3674 </a>
3675 </a>
3675 </td><td>
3676 </td><td>
3676 Wire Protocol RPC
3677 Wire Protocol RPC
3677 </td></tr>
3678 </td></tr>
3678 <tr><td>
3679 <tr><td>
3679 <a href="/help/internals.wireprotocolv2">
3680 <a href="/help/internals.wireprotocolv2">
3680 wireprotocolv2
3681 wireprotocolv2
3681 </a>
3682 </a>
3682 </td><td>
3683 </td><td>
3683 Wire Protocol Version 2
3684 Wire Protocol Version 2
3684 </td></tr>
3685 </td></tr>
3685
3686
3686
3687
3687
3688
3688
3689
3689
3690
3690 </table>
3691 </table>
3691 </div>
3692 </div>
3692 </div>
3693 </div>
3693
3694
3694
3695
3695
3696
3696 </body>
3697 </body>
3697 </html>
3698 </html>
3698
3699
3699
3700
3700 Sub-topic topics rendered properly
3701 Sub-topic topics rendered properly
3701
3702
3702 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3703 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3703 200 Script output follows
3704 200 Script output follows
3704
3705
3705 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3706 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3706 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3707 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3707 <head>
3708 <head>
3708 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3709 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3709 <meta name="robots" content="index, nofollow" />
3710 <meta name="robots" content="index, nofollow" />
3710 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3711 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3711 <script type="text/javascript" src="/static/mercurial.js"></script>
3712 <script type="text/javascript" src="/static/mercurial.js"></script>
3712
3713
3713 <title>Help: internals.changegroups</title>
3714 <title>Help: internals.changegroups</title>
3714 </head>
3715 </head>
3715 <body>
3716 <body>
3716
3717
3717 <div class="container">
3718 <div class="container">
3718 <div class="menu">
3719 <div class="menu">
3719 <div class="logo">
3720 <div class="logo">
3720 <a href="https://mercurial-scm.org/">
3721 <a href="https://mercurial-scm.org/">
3721 <img src="/static/hglogo.png" alt="mercurial" /></a>
3722 <img src="/static/hglogo.png" alt="mercurial" /></a>
3722 </div>
3723 </div>
3723 <ul>
3724 <ul>
3724 <li><a href="/shortlog">log</a></li>
3725 <li><a href="/shortlog">log</a></li>
3725 <li><a href="/graph">graph</a></li>
3726 <li><a href="/graph">graph</a></li>
3726 <li><a href="/tags">tags</a></li>
3727 <li><a href="/tags">tags</a></li>
3727 <li><a href="/bookmarks">bookmarks</a></li>
3728 <li><a href="/bookmarks">bookmarks</a></li>
3728 <li><a href="/branches">branches</a></li>
3729 <li><a href="/branches">branches</a></li>
3729 </ul>
3730 </ul>
3730 <ul>
3731 <ul>
3731 <li class="active"><a href="/help">help</a></li>
3732 <li class="active"><a href="/help">help</a></li>
3732 </ul>
3733 </ul>
3733 </div>
3734 </div>
3734
3735
3735 <div class="main">
3736 <div class="main">
3736 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3737 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3737 <h3>Help: internals.changegroups</h3>
3738 <h3>Help: internals.changegroups</h3>
3738
3739
3739 <form class="search" action="/log">
3740 <form class="search" action="/log">
3740
3741
3741 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3742 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3742 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3743 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3743 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3744 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3744 </form>
3745 </form>
3745 <div id="doc">
3746 <div id="doc">
3746 <h1>Changegroups</h1>
3747 <h1>Changegroups</h1>
3747 <p>
3748 <p>
3748 Changegroups are representations of repository revlog data, specifically
3749 Changegroups are representations of repository revlog data, specifically
3749 the changelog data, root/flat manifest data, treemanifest data, and
3750 the changelog data, root/flat manifest data, treemanifest data, and
3750 filelogs.
3751 filelogs.
3751 </p>
3752 </p>
3752 <p>
3753 <p>
3753 There are 4 versions of changegroups: &quot;1&quot;, &quot;2&quot;, &quot;3&quot; and &quot;4&quot;. From a
3754 There are 4 versions of changegroups: &quot;1&quot;, &quot;2&quot;, &quot;3&quot; and &quot;4&quot;. From a
3754 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3755 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3755 only difference being an additional item in the *delta header*. Version
3756 only difference being an additional item in the *delta header*. Version
3756 &quot;3&quot; adds support for storage flags in the *delta header* and optionally
3757 &quot;3&quot; adds support for storage flags in the *delta header* and optionally
3757 exchanging treemanifests (enabled by setting an option on the
3758 exchanging treemanifests (enabled by setting an option on the
3758 &quot;changegroup&quot; part in the bundle2). Version &quot;4&quot; adds support for exchanging
3759 &quot;changegroup&quot; part in the bundle2). Version &quot;4&quot; adds support for exchanging
3759 sidedata (additional revision metadata not part of the digest).
3760 sidedata (additional revision metadata not part of the digest).
3760 </p>
3761 </p>
3761 <p>
3762 <p>
3762 Changegroups when not exchanging treemanifests consist of 3 logical
3763 Changegroups when not exchanging treemanifests consist of 3 logical
3763 segments:
3764 segments:
3764 </p>
3765 </p>
3765 <pre>
3766 <pre>
3766 +---------------------------------+
3767 +---------------------------------+
3767 | | | |
3768 | | | |
3768 | changeset | manifest | filelogs |
3769 | changeset | manifest | filelogs |
3769 | | | |
3770 | | | |
3770 | | | |
3771 | | | |
3771 +---------------------------------+
3772 +---------------------------------+
3772 </pre>
3773 </pre>
3773 <p>
3774 <p>
3774 When exchanging treemanifests, there are 4 logical segments:
3775 When exchanging treemanifests, there are 4 logical segments:
3775 </p>
3776 </p>
3776 <pre>
3777 <pre>
3777 +-------------------------------------------------+
3778 +-------------------------------------------------+
3778 | | | | |
3779 | | | | |
3779 | changeset | root | treemanifests | filelogs |
3780 | changeset | root | treemanifests | filelogs |
3780 | | manifest | | |
3781 | | manifest | | |
3781 | | | | |
3782 | | | | |
3782 +-------------------------------------------------+
3783 +-------------------------------------------------+
3783 </pre>
3784 </pre>
3784 <p>
3785 <p>
3785 The principle building block of each segment is a *chunk*. A *chunk*
3786 The principle building block of each segment is a *chunk*. A *chunk*
3786 is a framed piece of data:
3787 is a framed piece of data:
3787 </p>
3788 </p>
3788 <pre>
3789 <pre>
3789 +---------------------------------------+
3790 +---------------------------------------+
3790 | | |
3791 | | |
3791 | length | data |
3792 | length | data |
3792 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3793 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3793 | | |
3794 | | |
3794 +---------------------------------------+
3795 +---------------------------------------+
3795 </pre>
3796 </pre>
3796 <p>
3797 <p>
3797 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3798 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3798 integer indicating the length of the entire chunk (including the length field
3799 integer indicating the length of the entire chunk (including the length field
3799 itself).
3800 itself).
3800 </p>
3801 </p>
3801 <p>
3802 <p>
3802 There is a special case chunk that has a value of 0 for the length
3803 There is a special case chunk that has a value of 0 for the length
3803 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3804 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3804 </p>
3805 </p>
3805 <h2>Delta Groups</h2>
3806 <h2>Delta Groups</h2>
3806 <p>
3807 <p>
3807 A *delta group* expresses the content of a revlog as a series of deltas,
3808 A *delta group* expresses the content of a revlog as a series of deltas,
3808 or patches against previous revisions.
3809 or patches against previous revisions.
3809 </p>
3810 </p>
3810 <p>
3811 <p>
3811 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3812 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3812 to signal the end of the delta group:
3813 to signal the end of the delta group:
3813 </p>
3814 </p>
3814 <pre>
3815 <pre>
3815 +------------------------------------------------------------------------+
3816 +------------------------------------------------------------------------+
3816 | | | | | |
3817 | | | | | |
3817 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3818 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3818 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3819 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3819 | | | | | |
3820 | | | | | |
3820 +------------------------------------------------------------------------+
3821 +------------------------------------------------------------------------+
3821 </pre>
3822 </pre>
3822 <p>
3823 <p>
3823 Each *chunk*'s data consists of the following:
3824 Each *chunk*'s data consists of the following:
3824 </p>
3825 </p>
3825 <pre>
3826 <pre>
3826 +---------------------------------------+
3827 +---------------------------------------+
3827 | | |
3828 | | |
3828 | delta header | delta data |
3829 | delta header | delta data |
3829 | (various by version) | (various) |
3830 | (various by version) | (various) |
3830 | | |
3831 | | |
3831 +---------------------------------------+
3832 +---------------------------------------+
3832 </pre>
3833 </pre>
3833 <p>
3834 <p>
3834 The *delta data* is a series of *delta*s that describe a diff from an existing
3835 The *delta data* is a series of *delta*s that describe a diff from an existing
3835 entry (either that the recipient already has, or previously specified in the
3836 entry (either that the recipient already has, or previously specified in the
3836 bundle/changegroup).
3837 bundle/changegroup).
3837 </p>
3838 </p>
3838 <p>
3839 <p>
3839 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, &quot;3&quot; and &quot;4&quot;
3840 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, &quot;3&quot; and &quot;4&quot;
3840 of the changegroup format.
3841 of the changegroup format.
3841 </p>
3842 </p>
3842 <p>
3843 <p>
3843 Version 1 (headerlen=80):
3844 Version 1 (headerlen=80):
3844 </p>
3845 </p>
3845 <pre>
3846 <pre>
3846 +------------------------------------------------------+
3847 +------------------------------------------------------+
3847 | | | | |
3848 | | | | |
3848 | node | p1 node | p2 node | link node |
3849 | node | p1 node | p2 node | link node |
3849 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3850 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3850 | | | | |
3851 | | | | |
3851 +------------------------------------------------------+
3852 +------------------------------------------------------+
3852 </pre>
3853 </pre>
3853 <p>
3854 <p>
3854 Version 2 (headerlen=100):
3855 Version 2 (headerlen=100):
3855 </p>
3856 </p>
3856 <pre>
3857 <pre>
3857 +------------------------------------------------------------------+
3858 +------------------------------------------------------------------+
3858 | | | | | |
3859 | | | | | |
3859 | node | p1 node | p2 node | base node | link node |
3860 | node | p1 node | p2 node | base node | link node |
3860 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3861 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3861 | | | | | |
3862 | | | | | |
3862 +------------------------------------------------------------------+
3863 +------------------------------------------------------------------+
3863 </pre>
3864 </pre>
3864 <p>
3865 <p>
3865 Version 3 (headerlen=102):
3866 Version 3 (headerlen=102):
3866 </p>
3867 </p>
3867 <pre>
3868 <pre>
3868 +------------------------------------------------------------------------------+
3869 +------------------------------------------------------------------------------+
3869 | | | | | | |
3870 | | | | | | |
3870 | node | p1 node | p2 node | base node | link node | flags |
3871 | node | p1 node | p2 node | base node | link node | flags |
3871 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3872 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3872 | | | | | | |
3873 | | | | | | |
3873 +------------------------------------------------------------------------------+
3874 +------------------------------------------------------------------------------+
3874 </pre>
3875 </pre>
3875 <p>
3876 <p>
3876 Version 4 (headerlen=103):
3877 Version 4 (headerlen=103):
3877 </p>
3878 </p>
3878 <pre>
3879 <pre>
3879 +------------------------------------------------------------------------------+----------+
3880 +------------------------------------------------------------------------------+----------+
3880 | | | | | | | |
3881 | | | | | | | |
3881 | node | p1 node | p2 node | base node | link node | flags | pflags |
3882 | node | p1 node | p2 node | base node | link node | flags | pflags |
3882 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) |
3883 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) |
3883 | | | | | | | |
3884 | | | | | | | |
3884 +------------------------------------------------------------------------------+----------+
3885 +------------------------------------------------------------------------------+----------+
3885 </pre>
3886 </pre>
3886 <p>
3887 <p>
3887 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3888 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3888 series of *delta*s, densely packed (no separators). These deltas describe a diff
3889 series of *delta*s, densely packed (no separators). These deltas describe a diff
3889 from an existing entry (either that the recipient already has, or previously
3890 from an existing entry (either that the recipient already has, or previously
3890 specified in the bundle/changegroup). The format is described more fully in
3891 specified in the bundle/changegroup). The format is described more fully in
3891 &quot;hg help internals.bdiff&quot;, but briefly:
3892 &quot;hg help internals.bdiff&quot;, but briefly:
3892 </p>
3893 </p>
3893 <pre>
3894 <pre>
3894 +---------------------------------------------------------------+
3895 +---------------------------------------------------------------+
3895 | | | | |
3896 | | | | |
3896 | start offset | end offset | new length | content |
3897 | start offset | end offset | new length | content |
3897 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3898 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3898 | | | | |
3899 | | | | |
3899 +---------------------------------------------------------------+
3900 +---------------------------------------------------------------+
3900 </pre>
3901 </pre>
3901 <p>
3902 <p>
3902 Please note that the length field in the delta data does *not* include itself.
3903 Please note that the length field in the delta data does *not* include itself.
3903 </p>
3904 </p>
3904 <p>
3905 <p>
3905 In version 1, the delta is always applied against the previous node from
3906 In version 1, the delta is always applied against the previous node from
3906 the changegroup or the first parent if this is the first entry in the
3907 the changegroup or the first parent if this is the first entry in the
3907 changegroup.
3908 changegroup.
3908 </p>
3909 </p>
3909 <p>
3910 <p>
3910 In version 2 and up, the delta base node is encoded in the entry in the
3911 In version 2 and up, the delta base node is encoded in the entry in the
3911 changegroup. This allows the delta to be expressed against any parent,
3912 changegroup. This allows the delta to be expressed against any parent,
3912 which can result in smaller deltas and more efficient encoding of data.
3913 which can result in smaller deltas and more efficient encoding of data.
3913 </p>
3914 </p>
3914 <p>
3915 <p>
3915 The *flags* field holds bitwise flags affecting the processing of revision
3916 The *flags* field holds bitwise flags affecting the processing of revision
3916 data. The following flags are defined:
3917 data. The following flags are defined:
3917 </p>
3918 </p>
3918 <dl>
3919 <dl>
3919 <dt>32768
3920 <dt>32768
3920 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions.
3921 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions.
3921 <dt>16384
3922 <dt>16384
3922 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents).
3923 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents).
3923 <dt>8192
3924 <dt>8192
3924 <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.
3925 <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.
3925 <dt>4096
3926 <dt>4096
3926 <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.
3927 <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.
3927 </dl>
3928 </dl>
3928 <p>
3929 <p>
3929 For historical reasons, the integer values are identical to revlog version 1
3930 For historical reasons, the integer values are identical to revlog version 1
3930 per-revision storage flags and correspond to bits being set in this 2-byte
3931 per-revision storage flags and correspond to bits being set in this 2-byte
3931 field. Bits were allocated starting from the most-significant bit, hence the
3932 field. Bits were allocated starting from the most-significant bit, hence the
3932 reverse ordering and allocation of these flags.
3933 reverse ordering and allocation of these flags.
3933 </p>
3934 </p>
3934 <p>
3935 <p>
3935 The *pflags* (protocol flags) field holds bitwise flags affecting the protocol
3936 The *pflags* (protocol flags) field holds bitwise flags affecting the protocol
3936 itself. They are first in the header since they may affect the handling of the
3937 itself. They are first in the header since they may affect the handling of the
3937 rest of the fields in a future version. They are defined as such:
3938 rest of the fields in a future version. They are defined as such:
3938 </p>
3939 </p>
3939 <dl>
3940 <dl>
3940 <dt>1 indicates whether to read a chunk of sidedata (of variable length) right
3941 <dt>1 indicates whether to read a chunk of sidedata (of variable length) right
3941 <dd>after the revision flags.
3942 <dd>after the revision flags.
3942 </dl>
3943 </dl>
3943 <h2>Changeset Segment</h2>
3944 <h2>Changeset Segment</h2>
3944 <p>
3945 <p>
3945 The *changeset segment* consists of a single *delta group* holding
3946 The *changeset segment* consists of a single *delta group* holding
3946 changelog data. The *empty chunk* at the end of the *delta group* denotes
3947 changelog data. The *empty chunk* at the end of the *delta group* denotes
3947 the boundary to the *manifest segment*.
3948 the boundary to the *manifest segment*.
3948 </p>
3949 </p>
3949 <h2>Manifest Segment</h2>
3950 <h2>Manifest Segment</h2>
3950 <p>
3951 <p>
3951 The *manifest segment* consists of a single *delta group* holding manifest
3952 The *manifest segment* consists of a single *delta group* holding manifest
3952 data. If treemanifests are in use, it contains only the manifest for the
3953 data. If treemanifests are in use, it contains only the manifest for the
3953 root directory of the repository. Otherwise, it contains the entire
3954 root directory of the repository. Otherwise, it contains the entire
3954 manifest data. The *empty chunk* at the end of the *delta group* denotes
3955 manifest data. The *empty chunk* at the end of the *delta group* denotes
3955 the boundary to the next segment (either the *treemanifests segment* or the
3956 the boundary to the next segment (either the *treemanifests segment* or the
3956 *filelogs segment*, depending on version and the request options).
3957 *filelogs segment*, depending on version and the request options).
3957 </p>
3958 </p>
3958 <h3>Treemanifests Segment</h3>
3959 <h3>Treemanifests Segment</h3>
3959 <p>
3960 <p>
3960 The *treemanifests segment* only exists in changegroup version &quot;3&quot; and &quot;4&quot;,
3961 The *treemanifests segment* only exists in changegroup version &quot;3&quot; and &quot;4&quot;,
3961 and only if the 'treemanifest' param is part of the bundle2 changegroup part
3962 and only if the 'treemanifest' param is part of the bundle2 changegroup part
3962 (it is not possible to use changegroup version 3 or 4 outside of bundle2).
3963 (it is not possible to use changegroup version 3 or 4 outside of bundle2).
3963 Aside from the filenames in the *treemanifests segment* containing a
3964 Aside from the filenames in the *treemanifests segment* containing a
3964 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3965 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3965 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3966 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3966 a sub-segment with filename size 0). This denotes the boundary to the
3967 a sub-segment with filename size 0). This denotes the boundary to the
3967 *filelogs segment*.
3968 *filelogs segment*.
3968 </p>
3969 </p>
3969 <h2>Filelogs Segment</h2>
3970 <h2>Filelogs Segment</h2>
3970 <p>
3971 <p>
3971 The *filelogs segment* consists of multiple sub-segments, each
3972 The *filelogs segment* consists of multiple sub-segments, each
3972 corresponding to an individual file whose data is being described:
3973 corresponding to an individual file whose data is being described:
3973 </p>
3974 </p>
3974 <pre>
3975 <pre>
3975 +--------------------------------------------------+
3976 +--------------------------------------------------+
3976 | | | | | |
3977 | | | | | |
3977 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3978 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3978 | | | | | (4 bytes) |
3979 | | | | | (4 bytes) |
3979 | | | | | |
3980 | | | | | |
3980 +--------------------------------------------------+
3981 +--------------------------------------------------+
3981 </pre>
3982 </pre>
3982 <p>
3983 <p>
3983 The final filelog sub-segment is followed by an *empty chunk* (logically,
3984 The final filelog sub-segment is followed by an *empty chunk* (logically,
3984 a sub-segment with filename size 0). This denotes the end of the segment
3985 a sub-segment with filename size 0). This denotes the end of the segment
3985 and of the overall changegroup.
3986 and of the overall changegroup.
3986 </p>
3987 </p>
3987 <p>
3988 <p>
3988 Each filelog sub-segment consists of the following:
3989 Each filelog sub-segment consists of the following:
3989 </p>
3990 </p>
3990 <pre>
3991 <pre>
3991 +------------------------------------------------------+
3992 +------------------------------------------------------+
3992 | | | |
3993 | | | |
3993 | filename length | filename | delta group |
3994 | filename length | filename | delta group |
3994 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3995 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3995 | | | |
3996 | | | |
3996 +------------------------------------------------------+
3997 +------------------------------------------------------+
3997 </pre>
3998 </pre>
3998 <p>
3999 <p>
3999 That is, a *chunk* consisting of the filename (not terminated or padded)
4000 That is, a *chunk* consisting of the filename (not terminated or padded)
4000 followed by N chunks constituting the *delta group* for this file. The
4001 followed by N chunks constituting the *delta group* for this file. The
4001 *empty chunk* at the end of each *delta group* denotes the boundary to the
4002 *empty chunk* at the end of each *delta group* denotes the boundary to the
4002 next filelog sub-segment.
4003 next filelog sub-segment.
4003 </p>
4004 </p>
4004
4005
4005 </div>
4006 </div>
4006 </div>
4007 </div>
4007 </div>
4008 </div>
4008
4009
4009
4010
4010
4011
4011 </body>
4012 </body>
4012 </html>
4013 </html>
4013
4014
4014
4015
4015 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
4016 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
4016 404 Not Found
4017 404 Not Found
4017
4018
4018 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4019 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4019 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
4020 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
4020 <head>
4021 <head>
4021 <link rel="icon" href="/static/hgicon.png" type="image/png" />
4022 <link rel="icon" href="/static/hgicon.png" type="image/png" />
4022 <meta name="robots" content="index, nofollow" />
4023 <meta name="robots" content="index, nofollow" />
4023 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
4024 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
4024 <script type="text/javascript" src="/static/mercurial.js"></script>
4025 <script type="text/javascript" src="/static/mercurial.js"></script>
4025
4026
4026 <title>test: error</title>
4027 <title>test: error</title>
4027 </head>
4028 </head>
4028 <body>
4029 <body>
4029
4030
4030 <div class="container">
4031 <div class="container">
4031 <div class="menu">
4032 <div class="menu">
4032 <div class="logo">
4033 <div class="logo">
4033 <a href="https://mercurial-scm.org/">
4034 <a href="https://mercurial-scm.org/">
4034 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
4035 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
4035 </div>
4036 </div>
4036 <ul>
4037 <ul>
4037 <li><a href="/shortlog">log</a></li>
4038 <li><a href="/shortlog">log</a></li>
4038 <li><a href="/graph">graph</a></li>
4039 <li><a href="/graph">graph</a></li>
4039 <li><a href="/tags">tags</a></li>
4040 <li><a href="/tags">tags</a></li>
4040 <li><a href="/bookmarks">bookmarks</a></li>
4041 <li><a href="/bookmarks">bookmarks</a></li>
4041 <li><a href="/branches">branches</a></li>
4042 <li><a href="/branches">branches</a></li>
4042 </ul>
4043 </ul>
4043 <ul>
4044 <ul>
4044 <li><a href="/help">help</a></li>
4045 <li><a href="/help">help</a></li>
4045 </ul>
4046 </ul>
4046 </div>
4047 </div>
4047
4048
4048 <div class="main">
4049 <div class="main">
4049
4050
4050 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
4051 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
4051 <h3>error</h3>
4052 <h3>error</h3>
4052
4053
4053
4054
4054 <form class="search" action="/log">
4055 <form class="search" action="/log">
4055
4056
4056 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
4057 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
4057 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
4058 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
4058 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
4059 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
4059 </form>
4060 </form>
4060
4061
4061 <div class="description">
4062 <div class="description">
4062 <p>
4063 <p>
4063 An error occurred while processing your request:
4064 An error occurred while processing your request:
4064 </p>
4065 </p>
4065 <p>
4066 <p>
4066 Not Found
4067 Not Found
4067 </p>
4068 </p>
4068 </div>
4069 </div>
4069 </div>
4070 </div>
4070 </div>
4071 </div>
4071
4072
4072
4073
4073
4074
4074 </body>
4075 </body>
4075 </html>
4076 </html>
4076
4077
4077 [1]
4078 [1]
4078
4079
4079 $ killdaemons.py
4080 $ killdaemons.py
4080
4081
4081 #endif
4082 #endif
General Comments 0
You need to be logged in to leave comments. Login now