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