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