##// END OF EJS Templates
help: support loading sub-topics...
Gregory Szorc -
r27379:2278870b default
parent child Browse files
Show More
@@ -1,565 +1,578 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 i18n import gettext, _
9 9 import itertools, os, textwrap
10 10 import error
11 11 import extensions, revset, fileset, templatekw, templatefilters, filemerge
12 12 import templater
13 13 import encoding, util, minirst
14 14 import cmdutil
15 15 import hgweb.webcommands as webcommands
16 16
17 17 _exclkeywords = [
18 18 "(DEPRECATED)",
19 19 "(EXPERIMENTAL)",
20 20 # i18n: "(DEPRECATED)" is a keyword, must be translated consistently
21 21 _("(DEPRECATED)"),
22 22 # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently
23 23 _("(EXPERIMENTAL)"),
24 24 ]
25 25
26 26 def listexts(header, exts, indent=1, showdeprecated=False):
27 27 '''return a text listing of the given extensions'''
28 28 rst = []
29 29 if exts:
30 30 for name, desc in sorted(exts.iteritems()):
31 31 if not showdeprecated and any(w in desc for w in _exclkeywords):
32 32 continue
33 33 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
34 34 if rst:
35 35 rst.insert(0, '\n%s\n\n' % header)
36 36 return rst
37 37
38 38 def extshelp(ui):
39 39 rst = loaddoc('extensions')(ui).splitlines(True)
40 40 rst.extend(listexts(
41 41 _('enabled extensions:'), extensions.enabled(), showdeprecated=True))
42 42 rst.extend(listexts(_('disabled extensions:'), extensions.disabled()))
43 43 doc = ''.join(rst)
44 44 return doc
45 45
46 46 def optrst(header, options, verbose):
47 47 data = []
48 48 multioccur = False
49 49 for option in options:
50 50 if len(option) == 5:
51 51 shortopt, longopt, default, desc, optlabel = option
52 52 else:
53 53 shortopt, longopt, default, desc = option
54 54 optlabel = _("VALUE") # default label
55 55
56 56 if not verbose and any(w in desc for w in _exclkeywords):
57 57 continue
58 58
59 59 so = ''
60 60 if shortopt:
61 61 so = '-' + shortopt
62 62 lo = '--' + longopt
63 63 if default:
64 64 desc += _(" (default: %s)") % default
65 65
66 66 if isinstance(default, list):
67 67 lo += " %s [+]" % optlabel
68 68 multioccur = True
69 69 elif (default is not None) and not isinstance(default, bool):
70 70 lo += " %s" % optlabel
71 71
72 72 data.append((so, lo, desc))
73 73
74 74 if multioccur:
75 75 header += (_(" ([+] can be repeated)"))
76 76
77 77 rst = ['\n%s:\n\n' % header]
78 78 rst.extend(minirst.maketable(data, 1))
79 79
80 80 return ''.join(rst)
81 81
82 82 def indicateomitted(rst, omitted, notomitted=None):
83 83 rst.append('\n\n.. container:: omitted\n\n %s\n\n' % omitted)
84 84 if notomitted:
85 85 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
86 86
87 87 def filtercmd(ui, cmd, kw, doc):
88 88 if not ui.debugflag and cmd.startswith("debug") and kw != "debug":
89 89 return True
90 90 if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
91 91 return True
92 92 return False
93 93
94 94 def topicmatch(ui, kw):
95 95 """Return help topics matching kw.
96 96
97 97 Returns {'section': [(name, summary), ...], ...} where section is
98 98 one of topics, commands, extensions, or extensioncommands.
99 99 """
100 100 kw = encoding.lower(kw)
101 101 def lowercontains(container):
102 102 return kw in encoding.lower(container) # translated in helptable
103 103 results = {'topics': [],
104 104 'commands': [],
105 105 'extensions': [],
106 106 'extensioncommands': [],
107 107 }
108 108 for names, header, doc in helptable:
109 109 # Old extensions may use a str as doc.
110 110 if (sum(map(lowercontains, names))
111 111 or lowercontains(header)
112 112 or (callable(doc) and lowercontains(doc(ui)))):
113 113 results['topics'].append((names[0], header))
114 114 import commands # avoid cycle
115 115 for cmd, entry in commands.table.iteritems():
116 116 if len(entry) == 3:
117 117 summary = entry[2]
118 118 else:
119 119 summary = ''
120 120 # translate docs *before* searching there
121 121 docs = _(getattr(entry[0], '__doc__', None)) or ''
122 122 if kw in cmd or lowercontains(summary) or lowercontains(docs):
123 123 doclines = docs.splitlines()
124 124 if doclines:
125 125 summary = doclines[0]
126 126 cmdname = cmd.partition('|')[0].lstrip('^')
127 127 if filtercmd(ui, cmdname, kw, docs):
128 128 continue
129 129 results['commands'].append((cmdname, summary))
130 130 for name, docs in itertools.chain(
131 131 extensions.enabled(False).iteritems(),
132 132 extensions.disabled().iteritems()):
133 133 # extensions.load ignores the UI argument
134 134 mod = extensions.load(None, name, '')
135 135 name = name.rpartition('.')[-1]
136 136 if lowercontains(name) or lowercontains(docs):
137 137 # extension docs are already translated
138 138 results['extensions'].append((name, docs.splitlines()[0]))
139 139 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems():
140 140 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])):
141 141 cmdname = cmd.partition('|')[0].lstrip('^')
142 142 if entry[0].__doc__:
143 143 cmddoc = gettext(entry[0].__doc__).splitlines()[0]
144 144 else:
145 145 cmddoc = _('(no help text available)')
146 146 results['extensioncommands'].append((cmdname, cmddoc))
147 147 return results
148 148
149 149 def loaddoc(topic, subdir=None):
150 150 """Return a delayed loader for help/topic.txt."""
151 151
152 152 def loader(ui):
153 153 docdir = os.path.join(util.datapath, 'help')
154 154 if subdir:
155 155 docdir = os.path.join(docdir, subdir)
156 156 path = os.path.join(docdir, topic + ".txt")
157 157 doc = gettext(util.readfile(path))
158 158 for rewriter in helphooks.get(topic, []):
159 159 doc = rewriter(ui, topic, doc)
160 160 return doc
161 161
162 162 return loader
163 163
164 164 internalstable = sorted([
165 165 (['bundles'], _('container for exchange of repository data'),
166 166 loaddoc('bundles', subdir='internals')),
167 167 (['changegroups'], _('representation of revlog data'),
168 168 loaddoc('changegroups', subdir='internals')),
169 169 ])
170 170
171 171 def internalshelp(ui):
172 172 """Generate the index for the "internals" topic."""
173 173 lines = []
174 174 for names, header, doc in internalstable:
175 175 lines.append(' :%s: %s' % (names[0], header))
176 176
177 177 return '\n'.join(lines)
178 178
179 179 helptable = sorted([
180 180 (["config", "hgrc"], _("Configuration Files"), loaddoc('config')),
181 181 (["dates"], _("Date Formats"), loaddoc('dates')),
182 182 (["patterns"], _("File Name Patterns"), loaddoc('patterns')),
183 183 (['environment', 'env'], _('Environment Variables'),
184 184 loaddoc('environment')),
185 185 (['revisions', 'revs'], _('Specifying Single Revisions'),
186 186 loaddoc('revisions')),
187 187 (['multirevs', 'mrevs'], _('Specifying Multiple Revisions'),
188 188 loaddoc('multirevs')),
189 189 (['revsets', 'revset'], _("Specifying Revision Sets"), loaddoc('revsets')),
190 190 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')),
191 191 (['diffs'], _('Diff Formats'), loaddoc('diffs')),
192 192 (['merge-tools', 'mergetools'], _('Merge Tools'), loaddoc('merge-tools')),
193 193 (['templating', 'templates', 'template', 'style'], _('Template Usage'),
194 194 loaddoc('templates')),
195 195 (['urls'], _('URL Paths'), loaddoc('urls')),
196 196 (["extensions"], _("Using Additional Features"), extshelp),
197 197 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos')),
198 198 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')),
199 199 (["glossary"], _("Glossary"), loaddoc('glossary')),
200 200 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"),
201 201 loaddoc('hgignore')),
202 202 (["phases"], _("Working with Phases"), loaddoc('phases')),
203 203 (['scripting'], _('Using Mercurial from scripts and automation'),
204 204 loaddoc('scripting')),
205 205 (['internals'], _("Technical implementation topics"),
206 206 internalshelp),
207 207 ])
208 208
209 # Maps topics with sub-topics to a list of their sub-topics.
210 subtopics = {
211 'internals': internalstable,
212 }
213
209 214 # Map topics to lists of callable taking the current topic help and
210 215 # returning the updated version
211 216 helphooks = {}
212 217
213 218 def addtopichook(topic, rewriter):
214 219 helphooks.setdefault(topic, []).append(rewriter)
215 220
216 221 def makeitemsdoc(ui, topic, doc, marker, items, dedent=False):
217 222 """Extract docstring from the items key to function mapping, build a
218 223 single documentation block and use it to overwrite the marker in doc.
219 224 """
220 225 entries = []
221 226 for name in sorted(items):
222 227 text = (items[name].__doc__ or '').rstrip()
223 228 if (not text
224 229 or not ui.verbose and any(w in text for w in _exclkeywords)):
225 230 continue
226 231 text = gettext(text)
227 232 if dedent:
228 233 text = textwrap.dedent(text)
229 234 lines = text.splitlines()
230 235 doclines = [(lines[0])]
231 236 for l in lines[1:]:
232 237 # Stop once we find some Python doctest
233 238 if l.strip().startswith('>>>'):
234 239 break
235 240 if dedent:
236 241 doclines.append(l.rstrip())
237 242 else:
238 243 doclines.append(' ' + l.strip())
239 244 entries.append('\n'.join(doclines))
240 245 entries = '\n\n'.join(entries)
241 246 return doc.replace(marker, entries)
242 247
243 248 def addtopicsymbols(topic, marker, symbols, dedent=False):
244 249 def add(ui, topic, doc):
245 250 return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent)
246 251 addtopichook(topic, add)
247 252
248 253 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
249 254 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
250 255 filemerge.internalsdoc)
251 256 addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols)
252 257 addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords)
253 258 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
254 259 addtopicsymbols('templates', '.. functionsmarker', templater.funcs)
255 260 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
256 261 dedent=True)
257 262
258 263 def help_(ui, name, unknowncmd=False, full=True, subtopic=None, **opts):
259 264 '''
260 265 Generate the help for 'name' as unformatted restructured text. If
261 266 'name' is None, describe the commands available.
262 267 '''
263 268
264 269 import commands # avoid cycle
265 270
266 271 def helpcmd(name, subtopic=None):
267 272 try:
268 273 aliases, entry = cmdutil.findcmd(name, commands.table,
269 274 strict=unknowncmd)
270 275 except error.AmbiguousCommand as inst:
271 276 # py3k fix: except vars can't be used outside the scope of the
272 277 # except block, nor can be used inside a lambda. python issue4617
273 278 prefix = inst.args[0]
274 279 select = lambda c: c.lstrip('^').startswith(prefix)
275 280 rst = helplist(select)
276 281 return rst
277 282
278 283 rst = []
279 284
280 285 # check if it's an invalid alias and display its error if it is
281 286 if getattr(entry[0], 'badalias', None):
282 287 rst.append(entry[0].badalias + '\n')
283 288 if entry[0].unknowncmd:
284 289 try:
285 290 rst.extend(helpextcmd(entry[0].cmdname))
286 291 except error.UnknownCommand:
287 292 pass
288 293 return rst
289 294
290 295 # synopsis
291 296 if len(entry) > 2:
292 297 if entry[2].startswith('hg'):
293 298 rst.append("%s\n" % entry[2])
294 299 else:
295 300 rst.append('hg %s %s\n' % (aliases[0], entry[2]))
296 301 else:
297 302 rst.append('hg %s\n' % aliases[0])
298 303 # aliases
299 304 if full and not ui.quiet and len(aliases) > 1:
300 305 rst.append(_("\naliases: %s\n") % ', '.join(aliases[1:]))
301 306 rst.append('\n')
302 307
303 308 # description
304 309 doc = gettext(entry[0].__doc__)
305 310 if not doc:
306 311 doc = _("(no help text available)")
307 312 if util.safehasattr(entry[0], 'definition'): # aliased command
308 313 if entry[0].definition.startswith('!'): # shell alias
309 314 doc = _('shell alias for::\n\n %s') % entry[0].definition[1:]
310 315 else:
311 316 doc = _('alias for: hg %s\n\n%s') % (entry[0].definition, doc)
312 317 doc = doc.splitlines(True)
313 318 if ui.quiet or not full:
314 319 rst.append(doc[0])
315 320 else:
316 321 rst.extend(doc)
317 322 rst.append('\n')
318 323
319 324 # check if this command shadows a non-trivial (multi-line)
320 325 # extension help text
321 326 try:
322 327 mod = extensions.find(name)
323 328 doc = gettext(mod.__doc__) or ''
324 329 if '\n' in doc.strip():
325 330 msg = _('(use "hg help -e %s" to show help for '
326 331 'the %s extension)') % (name, name)
327 332 rst.append('\n%s\n' % msg)
328 333 except KeyError:
329 334 pass
330 335
331 336 # options
332 337 if not ui.quiet and entry[1]:
333 338 rst.append(optrst(_("options"), entry[1], ui.verbose))
334 339
335 340 if ui.verbose:
336 341 rst.append(optrst(_("global options"),
337 342 commands.globalopts, ui.verbose))
338 343
339 344 if not ui.verbose:
340 345 if not full:
341 346 rst.append(_('\n(use "hg %s -h" to show more help)\n')
342 347 % name)
343 348 elif not ui.quiet:
344 349 rst.append(_('\n(some details hidden, use --verbose '
345 350 'to show complete help)'))
346 351
347 352 return rst
348 353
349 354
350 355 def helplist(select=None, **opts):
351 356 # list of commands
352 357 if name == "shortlist":
353 358 header = _('basic commands:\n\n')
354 359 elif name == "debug":
355 360 header = _('debug commands (internal and unsupported):\n\n')
356 361 else:
357 362 header = _('list of commands:\n\n')
358 363
359 364 h = {}
360 365 cmds = {}
361 366 for c, e in commands.table.iteritems():
362 367 f = c.partition("|")[0]
363 368 if select and not select(f):
364 369 continue
365 370 if (not select and name != 'shortlist' and
366 371 e[0].__module__ != commands.__name__):
367 372 continue
368 373 if name == "shortlist" and not f.startswith("^"):
369 374 continue
370 375 f = f.lstrip("^")
371 376 doc = e[0].__doc__
372 377 if filtercmd(ui, f, name, doc):
373 378 continue
374 379 doc = gettext(doc)
375 380 if not doc:
376 381 doc = _("(no help text available)")
377 382 h[f] = doc.splitlines()[0].rstrip()
378 383 cmds[f] = c.lstrip("^")
379 384
380 385 rst = []
381 386 if not h:
382 387 if not ui.quiet:
383 388 rst.append(_('no commands defined\n'))
384 389 return rst
385 390
386 391 if not ui.quiet:
387 392 rst.append(header)
388 393 fns = sorted(h)
389 394 for f in fns:
390 395 if ui.verbose:
391 396 commacmds = cmds[f].replace("|",", ")
392 397 rst.append(" :%s: %s\n" % (commacmds, h[f]))
393 398 else:
394 399 rst.append(' :%s: %s\n' % (f, h[f]))
395 400
396 401 ex = opts.get
397 402 anyopts = (ex('keyword') or not (ex('command') or ex('extension')))
398 403 if not name and anyopts:
399 404 exts = listexts(_('enabled extensions:'), extensions.enabled())
400 405 if exts:
401 406 rst.append('\n')
402 407 rst.extend(exts)
403 408
404 409 rst.append(_("\nadditional help topics:\n\n"))
405 410 topics = []
406 411 for names, header, doc in helptable:
407 412 topics.append((names[0], header))
408 413 for t, desc in topics:
409 414 rst.append(" :%s: %s\n" % (t, desc))
410 415
411 416 if ui.quiet:
412 417 pass
413 418 elif ui.verbose:
414 419 rst.append('\n%s\n' % optrst(_("global options"),
415 420 commands.globalopts, ui.verbose))
416 421 if name == 'shortlist':
417 422 rst.append(_('\n(use "hg help" for the full list '
418 423 'of commands)\n'))
419 424 else:
420 425 if name == 'shortlist':
421 426 rst.append(_('\n(use "hg help" for the full list of commands '
422 427 'or "hg -v" for details)\n'))
423 428 elif name and not full:
424 429 rst.append(_('\n(use "hg help %s" to show the full help '
425 430 'text)\n') % name)
426 431 elif name and cmds and name in cmds.keys():
427 432 rst.append(_('\n(use "hg help -v -e %s" to show built-in '
428 433 'aliases and global options)\n') % name)
429 434 else:
430 435 rst.append(_('\n(use "hg help -v%s" to show built-in aliases '
431 436 'and global options)\n')
432 437 % (name and " " + name or ""))
433 438 return rst
434 439
435 440 def helptopic(name, subtopic=None):
441 # Look for sub-topic entry first.
442 header, doc = None, None
443 if subtopic and name in subtopics:
444 for names, header, doc in subtopics[name]:
445 if subtopic in names:
446 break
447
448 if not header:
436 449 for names, header, doc in helptable:
437 450 if name in names:
438 451 break
439 452 else:
440 453 raise error.UnknownCommand(name)
441 454
442 455 rst = [minirst.section(header)]
443 456
444 457 # description
445 458 if not doc:
446 459 rst.append(" %s\n" % _("(no help text available)"))
447 460 if callable(doc):
448 461 rst += [" %s\n" % l for l in doc(ui).splitlines()]
449 462
450 463 if not ui.verbose:
451 464 omitted = _('(some details hidden, use --verbose'
452 465 ' to show complete help)')
453 466 indicateomitted(rst, omitted)
454 467
455 468 try:
456 469 cmdutil.findcmd(name, commands.table)
457 470 rst.append(_('\nuse "hg help -c %s" to see help for '
458 471 'the %s command\n') % (name, name))
459 472 except error.UnknownCommand:
460 473 pass
461 474 return rst
462 475
463 476 def helpext(name, subtopic=None):
464 477 try:
465 478 mod = extensions.find(name)
466 479 doc = gettext(mod.__doc__) or _('no help text available')
467 480 except KeyError:
468 481 mod = None
469 482 doc = extensions.disabledext(name)
470 483 if not doc:
471 484 raise error.UnknownCommand(name)
472 485
473 486 if '\n' not in doc:
474 487 head, tail = doc, ""
475 488 else:
476 489 head, tail = doc.split('\n', 1)
477 490 rst = [_('%s extension - %s\n\n') % (name.rpartition('.')[-1], head)]
478 491 if tail:
479 492 rst.extend(tail.splitlines(True))
480 493 rst.append('\n')
481 494
482 495 if not ui.verbose:
483 496 omitted = _('(some details hidden, use --verbose'
484 497 ' to show complete help)')
485 498 indicateomitted(rst, omitted)
486 499
487 500 if mod:
488 501 try:
489 502 ct = mod.cmdtable
490 503 except AttributeError:
491 504 ct = {}
492 505 modcmds = set([c.partition('|')[0] for c in ct])
493 506 rst.extend(helplist(modcmds.__contains__))
494 507 else:
495 508 rst.append(_('(use "hg help extensions" for information on enabling'
496 509 ' extensions)\n'))
497 510 return rst
498 511
499 512 def helpextcmd(name, subtopic=None):
500 513 cmd, ext, mod = extensions.disabledcmd(ui, name,
501 514 ui.configbool('ui', 'strict'))
502 515 doc = gettext(mod.__doc__).splitlines()[0]
503 516
504 517 rst = listexts(_("'%s' is provided by the following "
505 518 "extension:") % cmd, {ext: doc}, indent=4,
506 519 showdeprecated=True)
507 520 rst.append('\n')
508 521 rst.append(_('(use "hg help extensions" for information on enabling '
509 522 'extensions)\n'))
510 523 return rst
511 524
512 525
513 526 rst = []
514 527 kw = opts.get('keyword')
515 528 if kw or name is None and any(opts[o] for o in opts):
516 529 matches = topicmatch(ui, name or '')
517 530 helpareas = []
518 531 if opts.get('extension'):
519 532 helpareas += [('extensions', _('Extensions'))]
520 533 if opts.get('command'):
521 534 helpareas += [('commands', _('Commands'))]
522 535 if not helpareas:
523 536 helpareas = [('topics', _('Topics')),
524 537 ('commands', _('Commands')),
525 538 ('extensions', _('Extensions')),
526 539 ('extensioncommands', _('Extension Commands'))]
527 540 for t, title in helpareas:
528 541 if matches[t]:
529 542 rst.append('%s:\n\n' % title)
530 543 rst.extend(minirst.maketable(sorted(matches[t]), 1))
531 544 rst.append('\n')
532 545 if not rst:
533 546 msg = _('no matches')
534 547 hint = _('try "hg help" for a list of topics')
535 548 raise error.Abort(msg, hint=hint)
536 549 elif name and name != 'shortlist':
537 550 queries = []
538 551 if unknowncmd:
539 552 queries += [helpextcmd]
540 553 if opts.get('extension'):
541 554 queries += [helpext]
542 555 if opts.get('command'):
543 556 queries += [helpcmd]
544 557 if not queries:
545 558 queries = (helptopic, helpcmd, helpext, helpextcmd)
546 559 for f in queries:
547 560 try:
548 561 rst = f(name, subtopic)
549 562 break
550 563 except error.UnknownCommand:
551 564 pass
552 565 else:
553 566 if unknowncmd:
554 567 raise error.UnknownCommand(name)
555 568 else:
556 569 msg = _('no such help topic: %s') % name
557 570 hint = _('try "hg help --keyword %s"') % name
558 571 raise error.Abort(msg, hint=hint)
559 572 else:
560 573 # program name
561 574 if not ui.quiet:
562 575 rst = [_("Mercurial Distributed SCM\n"), '\n']
563 576 rst.extend(helplist(None, **opts))
564 577
565 578 return ''.join(rst)
@@ -1,2465 +1,2610 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 changegroup 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 for a pattern in specified files and revisions
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 changegroup 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 config Configuration Files
106 106 dates Date Formats
107 107 diffs Diff Formats
108 108 environment Environment Variables
109 109 extensions Using Additional Features
110 110 filesets Specifying File Sets
111 111 glossary Glossary
112 112 hgignore Syntax for Mercurial Ignore Files
113 113 hgweb Configuring hgweb
114 114 internals Technical implementation topics
115 115 merge-tools Merge Tools
116 116 multirevs Specifying Multiple Revisions
117 117 patterns File Name Patterns
118 118 phases Working with Phases
119 119 revisions Specifying Single Revisions
120 120 revsets Specifying Revision Sets
121 121 scripting Using Mercurial from scripts and automation
122 122 subrepos Subrepositories
123 123 templating Template Usage
124 124 urls URL Paths
125 125
126 126 (use "hg help -v" to show built-in aliases and global options)
127 127
128 128 $ hg -q help
129 129 add add the specified files on the next commit
130 130 addremove add all new files, delete all missing files
131 131 annotate show changeset information by line for each file
132 132 archive create an unversioned archive of a repository revision
133 133 backout reverse effect of earlier changeset
134 134 bisect subdivision search of changesets
135 135 bookmarks create a new bookmark or list existing bookmarks
136 136 branch set or show the current branch name
137 137 branches list repository named branches
138 138 bundle create a changegroup file
139 139 cat output the current or given revision of files
140 140 clone make a copy of an existing repository
141 141 commit commit the specified files or all outstanding changes
142 142 config show combined config settings from all hgrc files
143 143 copy mark files as copied for the next commit
144 144 diff diff repository (or selected files)
145 145 export dump the header and diffs for one or more changesets
146 146 files list tracked files
147 147 forget forget the specified files on the next commit
148 148 graft copy changes from other branches onto the current branch
149 149 grep search for a pattern in specified files and revisions
150 150 heads show branch heads
151 151 help show help for a given topic or a help overview
152 152 identify identify the working directory or specified revision
153 153 import import an ordered set of patches
154 154 incoming show new changesets found in source
155 155 init create a new repository in the given directory
156 156 log show revision history of entire repository or files
157 157 manifest output the current or given revision of the project manifest
158 158 merge merge another revision into working directory
159 159 outgoing show changesets not found in the destination
160 160 paths show aliases for remote repositories
161 161 phase set or show the current phase name
162 162 pull pull changes from the specified source
163 163 push push changes to the specified destination
164 164 recover roll back an interrupted transaction
165 165 remove remove the specified files on the next commit
166 166 rename rename files; equivalent of copy + remove
167 167 resolve redo merges or set/view the merge status of files
168 168 revert restore files to their checkout state
169 169 root print the root (top) of the current working directory
170 170 serve start stand-alone webserver
171 171 status show changed files in the working directory
172 172 summary summarize working directory state
173 173 tag add one or more tags for the current or given revision
174 174 tags list repository tags
175 175 unbundle apply one or more changegroup files
176 176 update update working directory (or switch revisions)
177 177 verify verify the integrity of the repository
178 178 version output version and copyright information
179 179
180 180 additional help topics:
181 181
182 182 config Configuration Files
183 183 dates Date Formats
184 184 diffs Diff Formats
185 185 environment Environment Variables
186 186 extensions Using Additional Features
187 187 filesets Specifying File Sets
188 188 glossary Glossary
189 189 hgignore Syntax for Mercurial Ignore Files
190 190 hgweb Configuring hgweb
191 191 internals Technical implementation topics
192 192 merge-tools Merge Tools
193 193 multirevs Specifying Multiple Revisions
194 194 patterns File Name Patterns
195 195 phases Working with Phases
196 196 revisions Specifying Single Revisions
197 197 revsets Specifying Revision Sets
198 198 scripting Using Mercurial from scripts and automation
199 199 subrepos Subrepositories
200 200 templating Template Usage
201 201 urls URL Paths
202 202
203 203 Test extension help:
204 204 $ hg help extensions --config extensions.rebase= --config extensions.children=
205 205 Using Additional Features
206 206 """""""""""""""""""""""""
207 207
208 208 Mercurial has the ability to add new features through the use of
209 209 extensions. Extensions may add new commands, add options to existing
210 210 commands, change the default behavior of commands, or implement hooks.
211 211
212 212 To enable the "foo" extension, either shipped with Mercurial or in the
213 213 Python search path, create an entry for it in your configuration file,
214 214 like this:
215 215
216 216 [extensions]
217 217 foo =
218 218
219 219 You may also specify the full path to an extension:
220 220
221 221 [extensions]
222 222 myfeature = ~/.hgext/myfeature.py
223 223
224 224 See "hg help config" for more information on configuration files.
225 225
226 226 Extensions are not loaded by default for a variety of reasons: they can
227 227 increase startup overhead; they may be meant for advanced usage only; they
228 228 may provide potentially dangerous abilities (such as letting you destroy
229 229 or modify history); they might not be ready for prime time; or they may
230 230 alter some usual behaviors of stock Mercurial. It is thus up to the user
231 231 to activate extensions as needed.
232 232
233 233 To explicitly disable an extension enabled in a configuration file of
234 234 broader scope, prepend its path with !:
235 235
236 236 [extensions]
237 237 # disabling extension bar residing in /path/to/extension/bar.py
238 238 bar = !/path/to/extension/bar.py
239 239 # ditto, but no path was supplied for extension baz
240 240 baz = !
241 241
242 242 enabled extensions:
243 243
244 244 children command to display child changesets (DEPRECATED)
245 245 rebase command to move sets of revisions to a different ancestor
246 246
247 247 disabled extensions:
248 248
249 249 acl hooks for controlling repository access
250 250 blackbox log repository events to a blackbox for debugging
251 251 bugzilla hooks for integrating with the Bugzilla bug tracker
252 252 censor erase file content at a given revision
253 253 churn command to display statistics about repository history
254 254 clonebundles advertise pre-generated bundles to seed clones
255 255 (experimental)
256 256 color colorize output from some commands
257 257 convert import revisions from foreign VCS repositories into
258 258 Mercurial
259 259 eol automatically manage newlines in repository files
260 260 extdiff command to allow external programs to compare revisions
261 261 factotum http authentication with factotum
262 262 gpg commands to sign and verify changesets
263 263 hgcia hooks for integrating with the CIA.vc notification service
264 264 hgk browse the repository in a graphical way
265 265 highlight syntax highlighting for hgweb (requires Pygments)
266 266 histedit interactive history editing
267 267 keyword expand keywords in tracked files
268 268 largefiles track large binary files
269 269 mq manage a stack of patches
270 270 notify hooks for sending email push notifications
271 271 pager browse command output with an external pager
272 272 patchbomb command to send changesets as (a series of) patch emails
273 273 purge command to delete untracked files from the working
274 274 directory
275 275 record commands to interactively select changes for
276 276 commit/qrefresh
277 277 relink recreates hardlinks between repository clones
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 286 Verify that extension keywords appear in help templates
287 287
288 288 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
289 289
290 290 Test short command list with verbose option
291 291
292 292 $ hg -v help shortlist
293 293 Mercurial Distributed SCM
294 294
295 295 basic commands:
296 296
297 297 add add the specified files on the next commit
298 298 annotate, blame
299 299 show changeset information by line for each file
300 300 clone make a copy of an existing repository
301 301 commit, ci commit the specified files or all outstanding changes
302 302 diff diff repository (or selected files)
303 303 export dump the header and diffs for one or more changesets
304 304 forget forget the specified files on the next commit
305 305 init create a new repository in the given directory
306 306 log, history show revision history of entire repository or files
307 307 merge merge another revision into working directory
308 308 pull pull changes from the specified source
309 309 push push changes to the specified destination
310 310 remove, rm remove the specified files on the next commit
311 311 serve start stand-alone webserver
312 312 status, st show changed files in the working directory
313 313 summary, sum summarize working directory state
314 314 update, up, checkout, co
315 315 update working directory (or switch revisions)
316 316
317 317 global options ([+] can be repeated):
318 318
319 319 -R --repository REPO repository root directory or name of overlay bundle
320 320 file
321 321 --cwd DIR change working directory
322 322 -y --noninteractive do not prompt, automatically pick the first choice for
323 323 all prompts
324 324 -q --quiet suppress output
325 325 -v --verbose enable additional output
326 326 --config CONFIG [+] set/override config option (use 'section.name=value')
327 327 --debug enable debugging output
328 328 --debugger start debugger
329 329 --encoding ENCODE set the charset encoding (default: ascii)
330 330 --encodingmode MODE set the charset encoding mode (default: strict)
331 331 --traceback always print a traceback on exception
332 332 --time time how long the command takes
333 333 --profile print command execution profile
334 334 --version output version information and exit
335 335 -h --help display help and exit
336 336 --hidden consider hidden changesets
337 337
338 338 (use "hg help" for the full list of commands)
339 339
340 340 $ hg add -h
341 341 hg add [OPTION]... [FILE]...
342 342
343 343 add the specified files on the next commit
344 344
345 345 Schedule files to be version controlled and added to the repository.
346 346
347 347 The files will be added to the repository at the next commit. To undo an
348 348 add before that, see "hg forget".
349 349
350 350 If no names are given, add all files to the repository.
351 351
352 352 Returns 0 if all files are successfully added.
353 353
354 354 options ([+] can be repeated):
355 355
356 356 -I --include PATTERN [+] include names matching the given patterns
357 357 -X --exclude PATTERN [+] exclude names matching the given patterns
358 358 -S --subrepos recurse into subrepositories
359 359 -n --dry-run do not perform actions, just print output
360 360
361 361 (some details hidden, use --verbose to show complete help)
362 362
363 363 Verbose help for add
364 364
365 365 $ hg add -hv
366 366 hg add [OPTION]... [FILE]...
367 367
368 368 add the specified files on the next commit
369 369
370 370 Schedule files to be version controlled and added to the repository.
371 371
372 372 The files will be added to the repository at the next commit. To undo an
373 373 add before that, see "hg forget".
374 374
375 375 If no names are given, add all files to the repository.
376 376
377 377 Examples:
378 378
379 379 - New (unknown) files are added automatically by "hg add":
380 380
381 381 $ ls
382 382 foo.c
383 383 $ hg status
384 384 ? foo.c
385 385 $ hg add
386 386 adding foo.c
387 387 $ hg status
388 388 A foo.c
389 389
390 390 - Specific files to be added can be specified:
391 391
392 392 $ ls
393 393 bar.c foo.c
394 394 $ hg status
395 395 ? bar.c
396 396 ? foo.c
397 397 $ hg add bar.c
398 398 $ hg status
399 399 A bar.c
400 400 ? foo.c
401 401
402 402 Returns 0 if all files are successfully added.
403 403
404 404 options ([+] can be repeated):
405 405
406 406 -I --include PATTERN [+] include names matching the given patterns
407 407 -X --exclude PATTERN [+] exclude names matching the given patterns
408 408 -S --subrepos recurse into subrepositories
409 409 -n --dry-run do not perform actions, just print output
410 410
411 411 global options ([+] can be repeated):
412 412
413 413 -R --repository REPO repository root directory or name of overlay bundle
414 414 file
415 415 --cwd DIR change working directory
416 416 -y --noninteractive do not prompt, automatically pick the first choice for
417 417 all prompts
418 418 -q --quiet suppress output
419 419 -v --verbose enable additional output
420 420 --config CONFIG [+] set/override config option (use 'section.name=value')
421 421 --debug enable debugging output
422 422 --debugger start debugger
423 423 --encoding ENCODE set the charset encoding (default: ascii)
424 424 --encodingmode MODE set the charset encoding mode (default: strict)
425 425 --traceback always print a traceback on exception
426 426 --time time how long the command takes
427 427 --profile print command execution profile
428 428 --version output version information and exit
429 429 -h --help display help and exit
430 430 --hidden consider hidden changesets
431 431
432 432 Test help option with version option
433 433
434 434 $ hg add -h --version
435 435 Mercurial Distributed SCM (version *) (glob)
436 436 (see https://mercurial-scm.org for more information)
437 437
438 438 Copyright (C) 2005-2015 Matt Mackall and others
439 439 This is free software; see the source for copying conditions. There is NO
440 440 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
441 441
442 442 $ hg add --skjdfks
443 443 hg add: option --skjdfks not recognized
444 444 hg add [OPTION]... [FILE]...
445 445
446 446 add the specified files on the next commit
447 447
448 448 options ([+] can be repeated):
449 449
450 450 -I --include PATTERN [+] include names matching the given patterns
451 451 -X --exclude PATTERN [+] exclude names matching the given patterns
452 452 -S --subrepos recurse into subrepositories
453 453 -n --dry-run do not perform actions, just print output
454 454
455 455 (use "hg add -h" to show more help)
456 456 [255]
457 457
458 458 Test ambiguous command help
459 459
460 460 $ hg help ad
461 461 list of commands:
462 462
463 463 add add the specified files on the next commit
464 464 addremove add all new files, delete all missing files
465 465
466 466 (use "hg help -v ad" to show built-in aliases and global options)
467 467
468 468 Test command without options
469 469
470 470 $ hg help verify
471 471 hg verify
472 472
473 473 verify the integrity of the repository
474 474
475 475 Verify the integrity of the current repository.
476 476
477 477 This will perform an extensive check of the repository's integrity,
478 478 validating the hashes and checksums of each entry in the changelog,
479 479 manifest, and tracked files, as well as the integrity of their crosslinks
480 480 and indices.
481 481
482 482 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
483 483 information about recovery from corruption of the repository.
484 484
485 485 Returns 0 on success, 1 if errors are encountered.
486 486
487 487 (some details hidden, use --verbose to show complete help)
488 488
489 489 $ hg help diff
490 490 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
491 491
492 492 diff repository (or selected files)
493 493
494 494 Show differences between revisions for the specified files.
495 495
496 496 Differences between files are shown using the unified diff format.
497 497
498 498 Note:
499 499 diff may generate unexpected results for merges, as it will default to
500 500 comparing against the working directory's first parent changeset if no
501 501 revisions are specified.
502 502
503 503 When two revision arguments are given, then changes are shown between
504 504 those revisions. If only one revision is specified then that revision is
505 505 compared to the working directory, and, when no revisions are specified,
506 506 the working directory files are compared to its parent.
507 507
508 508 Alternatively you can specify -c/--change with a revision to see the
509 509 changes in that changeset relative to its first parent.
510 510
511 511 Without the -a/--text option, diff will avoid generating diffs of files it
512 512 detects as binary. With -a, diff will generate a diff anyway, probably
513 513 with undesirable results.
514 514
515 515 Use the -g/--git option to generate diffs in the git extended diff format.
516 516 For more information, read "hg help diffs".
517 517
518 518 Returns 0 on success.
519 519
520 520 options ([+] can be repeated):
521 521
522 522 -r --rev REV [+] revision
523 523 -c --change REV change made by revision
524 524 -a --text treat all files as text
525 525 -g --git use git extended diff format
526 526 --nodates omit dates from diff headers
527 527 --noprefix omit a/ and b/ prefixes from filenames
528 528 -p --show-function show which function each change is in
529 529 --reverse produce a diff that undoes the changes
530 530 -w --ignore-all-space ignore white space when comparing lines
531 531 -b --ignore-space-change ignore changes in the amount of white space
532 532 -B --ignore-blank-lines ignore changes whose lines are all blank
533 533 -U --unified NUM number of lines of context to show
534 534 --stat output diffstat-style summary of changes
535 535 --root DIR produce diffs relative to subdirectory
536 536 -I --include PATTERN [+] include names matching the given patterns
537 537 -X --exclude PATTERN [+] exclude names matching the given patterns
538 538 -S --subrepos recurse into subrepositories
539 539
540 540 (some details hidden, use --verbose to show complete help)
541 541
542 542 $ hg help status
543 543 hg status [OPTION]... [FILE]...
544 544
545 545 aliases: st
546 546
547 547 show changed files in the working directory
548 548
549 549 Show status of files in the repository. If names are given, only files
550 550 that match are shown. Files that are clean or ignored or the source of a
551 551 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
552 552 -C/--copies or -A/--all are given. Unless options described with "show
553 553 only ..." are given, the options -mardu are used.
554 554
555 555 Option -q/--quiet hides untracked (unknown and ignored) files unless
556 556 explicitly requested with -u/--unknown or -i/--ignored.
557 557
558 558 Note:
559 559 status may appear to disagree with diff if permissions have changed or
560 560 a merge has occurred. The standard diff format does not report
561 561 permission changes and diff only reports changes relative to one merge
562 562 parent.
563 563
564 564 If one revision is given, it is used as the base revision. If two
565 565 revisions are given, the differences between them are shown. The --change
566 566 option can also be used as a shortcut to list the changed files of a
567 567 revision from its first parent.
568 568
569 569 The codes used to show the status of files are:
570 570
571 571 M = modified
572 572 A = added
573 573 R = removed
574 574 C = clean
575 575 ! = missing (deleted by non-hg command, but still tracked)
576 576 ? = not tracked
577 577 I = ignored
578 578 = origin of the previous file (with --copies)
579 579
580 580 Returns 0 on success.
581 581
582 582 options ([+] can be repeated):
583 583
584 584 -A --all show status of all files
585 585 -m --modified show only modified files
586 586 -a --added show only added files
587 587 -r --removed show only removed files
588 588 -d --deleted show only deleted (but tracked) files
589 589 -c --clean show only files without changes
590 590 -u --unknown show only unknown (not tracked) files
591 591 -i --ignored show only ignored files
592 592 -n --no-status hide status prefix
593 593 -C --copies show source of copied files
594 594 -0 --print0 end filenames with NUL, for use with xargs
595 595 --rev REV [+] show difference from revision
596 596 --change REV list the changed files of a revision
597 597 -I --include PATTERN [+] include names matching the given patterns
598 598 -X --exclude PATTERN [+] exclude names matching the given patterns
599 599 -S --subrepos recurse into subrepositories
600 600
601 601 (some details hidden, use --verbose to show complete help)
602 602
603 603 $ hg -q help status
604 604 hg status [OPTION]... [FILE]...
605 605
606 606 show changed files in the working directory
607 607
608 608 $ hg help foo
609 609 abort: no such help topic: foo
610 610 (try "hg help --keyword foo")
611 611 [255]
612 612
613 613 $ hg skjdfks
614 614 hg: unknown command 'skjdfks'
615 615 Mercurial Distributed SCM
616 616
617 617 basic commands:
618 618
619 619 add add the specified files on the next commit
620 620 annotate show changeset information by line for each file
621 621 clone make a copy of an existing repository
622 622 commit commit the specified files or all outstanding changes
623 623 diff diff repository (or selected files)
624 624 export dump the header and diffs for one or more changesets
625 625 forget forget the specified files on the next commit
626 626 init create a new repository in the given directory
627 627 log show revision history of entire repository or files
628 628 merge merge another revision into working directory
629 629 pull pull changes from the specified source
630 630 push push changes to the specified destination
631 631 remove remove the specified files on the next commit
632 632 serve start stand-alone webserver
633 633 status show changed files in the working directory
634 634 summary summarize working directory state
635 635 update update working directory (or switch revisions)
636 636
637 637 (use "hg help" for the full list of commands or "hg -v" for details)
638 638 [255]
639 639
640 640
641 641 Make sure that we don't run afoul of the help system thinking that
642 642 this is a section and erroring out weirdly.
643 643
644 644 $ hg .log
645 645 hg: unknown command '.log'
646 646 (did you mean one of log?)
647 647 [255]
648 648
649 649 $ hg log.
650 650 hg: unknown command 'log.'
651 651 (did you mean one of log?)
652 652 [255]
653 653 $ hg pu.lh
654 654 hg: unknown command 'pu.lh'
655 655 (did you mean one of pull, push?)
656 656 [255]
657 657
658 658 $ cat > helpext.py <<EOF
659 659 > import os
660 660 > from mercurial import cmdutil, commands
661 661 >
662 662 > cmdtable = {}
663 663 > command = cmdutil.command(cmdtable)
664 664 >
665 665 > @command('nohelp',
666 666 > [('', 'longdesc', 3, 'x'*90),
667 667 > ('n', '', None, 'normal desc'),
668 668 > ('', 'newline', '', 'line1\nline2')],
669 669 > 'hg nohelp',
670 670 > norepo=True)
671 671 > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')])
672 672 > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')])
673 673 > def nohelp(ui, *args, **kwargs):
674 674 > pass
675 675 >
676 676 > EOF
677 677 $ echo '[extensions]' >> $HGRCPATH
678 678 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
679 679
680 680 Test command with no help text
681 681
682 682 $ hg help nohelp
683 683 hg nohelp
684 684
685 685 (no help text available)
686 686
687 687 options:
688 688
689 689 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
690 690 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
691 691 -n -- normal desc
692 692 --newline VALUE line1 line2
693 693
694 694 (some details hidden, use --verbose to show complete help)
695 695
696 696 $ hg help -k nohelp
697 697 Commands:
698 698
699 699 nohelp hg nohelp
700 700
701 701 Extension Commands:
702 702
703 703 nohelp (no help text available)
704 704
705 705 Test that default list of commands omits extension commands
706 706
707 707 $ hg help
708 708 Mercurial Distributed SCM
709 709
710 710 list of commands:
711 711
712 712 add add the specified files on the next commit
713 713 addremove add all new files, delete all missing files
714 714 annotate show changeset information by line for each file
715 715 archive create an unversioned archive of a repository revision
716 716 backout reverse effect of earlier changeset
717 717 bisect subdivision search of changesets
718 718 bookmarks create a new bookmark or list existing bookmarks
719 719 branch set or show the current branch name
720 720 branches list repository named branches
721 721 bundle create a changegroup file
722 722 cat output the current or given revision of files
723 723 clone make a copy of an existing repository
724 724 commit commit the specified files or all outstanding changes
725 725 config show combined config settings from all hgrc files
726 726 copy mark files as copied for the next commit
727 727 diff diff repository (or selected files)
728 728 export dump the header and diffs for one or more changesets
729 729 files list tracked files
730 730 forget forget the specified files on the next commit
731 731 graft copy changes from other branches onto the current branch
732 732 grep search for a pattern in specified files and revisions
733 733 heads show branch heads
734 734 help show help for a given topic or a help overview
735 735 identify identify the working directory or specified revision
736 736 import import an ordered set of patches
737 737 incoming show new changesets found in source
738 738 init create a new repository in the given directory
739 739 log show revision history of entire repository or files
740 740 manifest output the current or given revision of the project manifest
741 741 merge merge another revision into working directory
742 742 outgoing show changesets not found in the destination
743 743 paths show aliases for remote repositories
744 744 phase set or show the current phase name
745 745 pull pull changes from the specified source
746 746 push push changes to the specified destination
747 747 recover roll back an interrupted transaction
748 748 remove remove the specified files on the next commit
749 749 rename rename files; equivalent of copy + remove
750 750 resolve redo merges or set/view the merge status of files
751 751 revert restore files to their checkout state
752 752 root print the root (top) of the current working directory
753 753 serve start stand-alone webserver
754 754 status show changed files in the working directory
755 755 summary summarize working directory state
756 756 tag add one or more tags for the current or given revision
757 757 tags list repository tags
758 758 unbundle apply one or more changegroup files
759 759 update update working directory (or switch revisions)
760 760 verify verify the integrity of the repository
761 761 version output version and copyright information
762 762
763 763 enabled extensions:
764 764
765 765 helpext (no help text available)
766 766
767 767 additional help topics:
768 768
769 769 config Configuration Files
770 770 dates Date Formats
771 771 diffs Diff Formats
772 772 environment Environment Variables
773 773 extensions Using Additional Features
774 774 filesets Specifying File Sets
775 775 glossary Glossary
776 776 hgignore Syntax for Mercurial Ignore Files
777 777 hgweb Configuring hgweb
778 778 internals Technical implementation topics
779 779 merge-tools Merge Tools
780 780 multirevs Specifying Multiple Revisions
781 781 patterns File Name Patterns
782 782 phases Working with Phases
783 783 revisions Specifying Single Revisions
784 784 revsets Specifying Revision Sets
785 785 scripting Using Mercurial from scripts and automation
786 786 subrepos Subrepositories
787 787 templating Template Usage
788 788 urls URL Paths
789 789
790 790 (use "hg help -v" to show built-in aliases and global options)
791 791
792 792
793 793 Test list of internal help commands
794 794
795 795 $ hg help debug
796 796 debug commands (internal and unsupported):
797 797
798 798 debugancestor
799 799 find the ancestor revision of two revisions in a given index
800 800 debugapplystreamclonebundle
801 801 apply a stream clone bundle file
802 802 debugbuilddag
803 803 builds a repo with a given DAG from scratch in the current
804 804 empty repo
805 805 debugbundle lists the contents of a bundle
806 806 debugcheckstate
807 807 validate the correctness of the current dirstate
808 808 debugcommands
809 809 list all available commands and options
810 810 debugcomplete
811 811 returns the completion list associated with the given command
812 812 debugcreatestreamclonebundle
813 813 create a stream clone bundle file
814 814 debugdag format the changelog or an index DAG as a concise textual
815 815 description
816 816 debugdata dump the contents of a data file revision
817 817 debugdate parse and display a date
818 818 debugdeltachain
819 819 dump information about delta chains in a revlog
820 820 debugdirstate
821 821 show the contents of the current dirstate
822 822 debugdiscovery
823 823 runs the changeset discovery protocol in isolation
824 824 debugextensions
825 825 show information about active extensions
826 826 debugfileset parse and apply a fileset specification
827 827 debugfsinfo show information detected about current filesystem
828 828 debuggetbundle
829 829 retrieves a bundle from a repo
830 830 debugignore display the combined ignore pattern
831 831 debugindex dump the contents of an index file
832 832 debugindexdot
833 833 dump an index DAG as a graphviz dot file
834 834 debuginstall test Mercurial installation
835 835 debugknown test whether node ids are known to a repo
836 836 debuglocks show or modify state of locks
837 837 debugmergestate
838 838 print merge state
839 839 debugnamecomplete
840 840 complete "names" - tags, open branch names, bookmark names
841 841 debugobsolete
842 842 create arbitrary obsolete marker
843 843 debugoptDEP (no help text available)
844 844 debugoptEXP (no help text available)
845 845 debugpathcomplete
846 846 complete part or all of a tracked path
847 847 debugpushkey access the pushkey key/value protocol
848 848 debugpvec (no help text available)
849 849 debugrebuilddirstate
850 850 rebuild the dirstate as it would look like for the given
851 851 revision
852 852 debugrebuildfncache
853 853 rebuild the fncache file
854 854 debugrename dump rename information
855 855 debugrevlog show data and statistics about a revlog
856 856 debugrevspec parse and apply a revision specification
857 857 debugsetparents
858 858 manually set the parents of the current working directory
859 859 debugsub (no help text available)
860 860 debugsuccessorssets
861 861 show set of successors for revision
862 862 debugwalk show how files match on given patterns
863 863 debugwireargs
864 864 (no help text available)
865 865
866 866 (use "hg help -v debug" to show built-in aliases and global options)
867 867
868 868 internals topic renders index of available sub-topics
869 869
870 870 $ hg help internals
871 871 Technical implementation topics
872 872 """""""""""""""""""""""""""""""
873 873
874 874 bundles container for exchange of repository data
875 875 changegroups representation of revlog data
876 876
877 sub-topics can be accessed
878
879 $ hg help internals.changegroups
880 Changegroups
881 ============
882
883 Changegroups are representations of repository revlog data, specifically
884 the changelog, manifest, and filelogs.
885
886 There are 2 versions of changegroups: "1" and "2". From a high-level, they
887 are almost exactly the same, with the only difference being a header on
888 entries in the changeset segment.
889
890 Changegroups consists of 3 logical segments:
891
892 +---------------------------------+
893 | | | |
894 | changeset | manifest | filelogs |
895 | | | |
896 +---------------------------------+
897
898 The principle building block of each segment is a *chunk*. A *chunk* is a
899 framed piece of data:
900
901 +---------------------------------------+
902 | | |
903 | length | data |
904 | (32 bits) | <length> bytes |
905 | | |
906 +---------------------------------------+
907
908 Each chunk starts with a 32-bit big-endian signed integer indicating the
909 length of the raw data that follows.
910
911 There is a special case chunk that has 0 length ("0x00000000"). We call
912 this an *empty chunk*.
913
914 Delta Groups
915 ------------
916
917 A *delta group* expresses the content of a revlog as a series of deltas,
918 or patches against previous revisions.
919
920 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
921 to signal the end of the delta group:
922
923 +------------------------------------------------------------------------+
924 | | | | | |
925 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
926 | (32 bits) | (various) | (32 bits) | (various) | (32 bits) |
927 | | | | | |
928 +------------------------------------------------------------+-----------+
929
930 Each *chunk*'s data consists of the following:
931
932 +-----------------------------------------+
933 | | | |
934 | delta header | mdiff header | delta |
935 | (various) | (12 bytes) | (various) |
936 | | | |
937 +-----------------------------------------+
938
939 The *length* field is the byte length of the remaining 3 logical pieces of
940 data. The *delta* is a diff from an existing entry in the changelog.
941
942 The *delta header* is different between versions "1" and "2" of the
943 changegroup format.
944
945 Version 1:
946
947 +------------------------------------------------------+
948 | | | | |
949 | node | p1 node | p2 node | link node |
950 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
951 | | | | |
952 +------------------------------------------------------+
953
954 Version 2:
955
956 +------------------------------------------------------------------+
957 | | | | | |
958 | node | p1 node | p2 node | base node | link node |
959 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
960 | | | | | |
961 +------------------------------------------------------------------+
962
963 The *mdiff header* consists of 3 32-bit big-endian signed integers
964 describing offsets at which to apply the following delta content:
965
966 +-------------------------------------+
967 | | | |
968 | offset | old length | new length |
969 | (32 bits) | (32 bits) | (32 bits) |
970 | | | |
971 +-------------------------------------+
972
973 In version 1, the delta is always applied against the previous node from
974 the changegroup or the first parent if this is the first entry in the
975 changegroup.
976
977 In version 2, the delta base node is encoded in the entry in the
978 changegroup. This allows the delta to be expressed against any parent,
979 which can result in smaller deltas and more efficient encoding of data.
980
981 Changeset Segment
982 -----------------
983
984 The *changeset segment* consists of a single *delta group* holding
985 changelog data. It is followed by an *empty chunk* to denote the boundary
986 to the *manifests segment*.
987
988 Manifest Segment
989 ----------------
990
991 The *manifest segment* consists of a single *delta group* holding manifest
992 data. It is followed by an *empty chunk* to denote the boundary to the
993 *filelogs segment*.
994
995 Filelogs Segment
996 ----------------
997
998 The *filelogs* segment consists of multiple sub-segments, each
999 corresponding to an individual file whose data is being described:
1000
1001 +--------------------------------------+
1002 | | | | |
1003 | filelog0 | filelog1 | filelog2 | ... |
1004 | | | | |
1005 +--------------------------------------+
1006
1007 The final filelog sub-segment is followed by an *empty chunk* to denote
1008 the end of the segment and the overall changegroup.
1009
1010 Each filelog sub-segment consists of the following:
1011
1012 +------------------------------------------+
1013 | | | |
1014 | filename size | filename | delta group |
1015 | (32 bits) | (various) | (various) |
1016 | | | |
1017 +------------------------------------------+
1018
1019 That is, a *chunk* consisting of the filename (not terminated or padded)
1020 followed by N chunks constituting the *delta group* for this file.
1021
877 1022 Test list of commands with command with no help text
878 1023
879 1024 $ hg help helpext
880 1025 helpext extension - no help text available
881 1026
882 1027 list of commands:
883 1028
884 1029 nohelp (no help text available)
885 1030
886 1031 (use "hg help -v helpext" to show built-in aliases and global options)
887 1032
888 1033
889 1034 test deprecated and experimental options are hidden in command help
890 1035 $ hg help debugoptDEP
891 1036 hg debugoptDEP
892 1037
893 1038 (no help text available)
894 1039
895 1040 options:
896 1041
897 1042 (some details hidden, use --verbose to show complete help)
898 1043
899 1044 $ hg help debugoptEXP
900 1045 hg debugoptEXP
901 1046
902 1047 (no help text available)
903 1048
904 1049 options:
905 1050
906 1051 (some details hidden, use --verbose to show complete help)
907 1052
908 1053 test deprecated and experimental options is shown with -v
909 1054 $ hg help -v debugoptDEP | grep dopt
910 1055 --dopt option is (DEPRECATED)
911 1056 $ hg help -v debugoptEXP | grep eopt
912 1057 --eopt option is (EXPERIMENTAL)
913 1058
914 1059 #if gettext
915 1060 test deprecated option is hidden with translation with untranslated description
916 1061 (use many globy for not failing on changed transaction)
917 1062 $ LANGUAGE=sv hg help debugoptDEP
918 1063 hg debugoptDEP
919 1064
920 1065 (*) (glob)
921 1066
922 1067 options:
923 1068
924 1069 (some details hidden, use --verbose to show complete help)
925 1070 #endif
926 1071
927 1072 Test commands that collide with topics (issue4240)
928 1073
929 1074 $ hg config -hq
930 1075 hg config [-u] [NAME]...
931 1076
932 1077 show combined config settings from all hgrc files
933 1078 $ hg showconfig -hq
934 1079 hg config [-u] [NAME]...
935 1080
936 1081 show combined config settings from all hgrc files
937 1082
938 1083 Test a help topic
939 1084
940 1085 $ hg help revs
941 1086 Specifying Single Revisions
942 1087 """""""""""""""""""""""""""
943 1088
944 1089 Mercurial supports several ways to specify individual revisions.
945 1090
946 1091 A plain integer is treated as a revision number. Negative integers are
947 1092 treated as sequential offsets from the tip, with -1 denoting the tip, -2
948 1093 denoting the revision prior to the tip, and so forth.
949 1094
950 1095 A 40-digit hexadecimal string is treated as a unique revision identifier.
951 1096
952 1097 A hexadecimal string less than 40 characters long is treated as a unique
953 1098 revision identifier and is referred to as a short-form identifier. A
954 1099 short-form identifier is only valid if it is the prefix of exactly one
955 1100 full-length identifier.
956 1101
957 1102 Any other string is treated as a bookmark, tag, or branch name. A bookmark
958 1103 is a movable pointer to a revision. A tag is a permanent name associated
959 1104 with a revision. A branch name denotes the tipmost open branch head of
960 1105 that branch - or if they are all closed, the tipmost closed head of the
961 1106 branch. Bookmark, tag, and branch names must not contain the ":"
962 1107 character.
963 1108
964 1109 The reserved name "tip" always identifies the most recent revision.
965 1110
966 1111 The reserved name "null" indicates the null revision. This is the revision
967 1112 of an empty repository, and the parent of revision 0.
968 1113
969 1114 The reserved name "." indicates the working directory parent. If no
970 1115 working directory is checked out, it is equivalent to null. If an
971 1116 uncommitted merge is in progress, "." is the revision of the first parent.
972 1117
973 1118 Test repeated config section name
974 1119
975 1120 $ hg help config.host
976 1121 "http_proxy.host"
977 1122 Host name and (optional) port of the proxy server, for example
978 1123 "myproxy:8000".
979 1124
980 1125 "smtp.host"
981 1126 Host name of mail server, e.g. "mail.example.com".
982 1127
983 1128 Unrelated trailing paragraphs shouldn't be included
984 1129
985 1130 $ hg help config.extramsg | grep '^$'
986 1131
987 1132
988 1133 Test capitalized section name
989 1134
990 1135 $ hg help scripting.HGPLAIN > /dev/null
991 1136
992 1137 Help subsection:
993 1138
994 1139 $ hg help config.charsets |grep "Email example:" > /dev/null
995 1140 [1]
996 1141
997 1142 Show nested definitions
998 1143 ("profiling.type"[break]"ls"[break]"stat"[break])
999 1144
1000 1145 $ hg help config.type | egrep '^$'|wc -l
1001 1146 \s*3 (re)
1002 1147
1003 1148 Last item in help config.*:
1004 1149
1005 1150 $ hg help config.`hg help config|grep '^ "'| \
1006 1151 > tail -1|sed 's![ "]*!!g'`| \
1007 1152 > grep "hg help -c config" > /dev/null
1008 1153 [1]
1009 1154
1010 1155 note to use help -c for general hg help config:
1011 1156
1012 1157 $ hg help config |grep "hg help -c config" > /dev/null
1013 1158
1014 1159 Test templating help
1015 1160
1016 1161 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1017 1162 desc String. The text of the changeset description.
1018 1163 diffstat String. Statistics of changes with the following format:
1019 1164 firstline Any text. Returns the first line of text.
1020 1165 nonempty Any text. Returns '(none)' if the string is empty.
1021 1166
1022 1167 Test deprecated items
1023 1168
1024 1169 $ hg help -v templating | grep currentbookmark
1025 1170 currentbookmark
1026 1171 $ hg help templating | (grep currentbookmark || true)
1027 1172
1028 1173 Test help hooks
1029 1174
1030 1175 $ cat > helphook1.py <<EOF
1031 1176 > from mercurial import help
1032 1177 >
1033 1178 > def rewrite(ui, topic, doc):
1034 1179 > return doc + '\nhelphook1\n'
1035 1180 >
1036 1181 > def extsetup(ui):
1037 1182 > help.addtopichook('revsets', rewrite)
1038 1183 > EOF
1039 1184 $ cat > helphook2.py <<EOF
1040 1185 > from mercurial import help
1041 1186 >
1042 1187 > def rewrite(ui, topic, doc):
1043 1188 > return doc + '\nhelphook2\n'
1044 1189 >
1045 1190 > def extsetup(ui):
1046 1191 > help.addtopichook('revsets', rewrite)
1047 1192 > EOF
1048 1193 $ echo '[extensions]' >> $HGRCPATH
1049 1194 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1050 1195 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1051 1196 $ hg help revsets | grep helphook
1052 1197 helphook1
1053 1198 helphook2
1054 1199
1055 1200 help -c should only show debug --debug
1056 1201
1057 1202 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1058 1203 [1]
1059 1204
1060 1205 help -c should only show deprecated for -v
1061 1206
1062 1207 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1063 1208 [1]
1064 1209
1065 1210 Test -e / -c / -k combinations
1066 1211
1067 1212 $ hg help -c|egrep '^\S|debug'
1068 1213 Commands:
1069 1214 $ hg help -e|egrep '^\S'
1070 1215 Extensions:
1071 1216 $ hg help -k|egrep '^\S'
1072 1217 Topics:
1073 1218 Commands:
1074 1219 Extensions:
1075 1220 Extension Commands:
1076 1221 $ hg help -c schemes
1077 1222 abort: no such help topic: schemes
1078 1223 (try "hg help --keyword schemes")
1079 1224 [255]
1080 1225 $ hg help -e schemes |head -1
1081 1226 schemes extension - extend schemes with shortcuts to repository swarms
1082 1227 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1083 1228 Commands:
1084 1229 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1085 1230 Extensions:
1086 1231 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1087 1232 Extensions:
1088 1233 Commands:
1089 1234 $ hg help -c commit > /dev/null
1090 1235 $ hg help -e -c commit > /dev/null
1091 1236 $ hg help -e commit > /dev/null
1092 1237 abort: no such help topic: commit
1093 1238 (try "hg help --keyword commit")
1094 1239 [255]
1095 1240
1096 1241 Test keyword search help
1097 1242
1098 1243 $ cat > prefixedname.py <<EOF
1099 1244 > '''matched against word "clone"
1100 1245 > '''
1101 1246 > EOF
1102 1247 $ echo '[extensions]' >> $HGRCPATH
1103 1248 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1104 1249 $ hg help -k clone
1105 1250 Topics:
1106 1251
1107 1252 config Configuration Files
1108 1253 extensions Using Additional Features
1109 1254 glossary Glossary
1110 1255 phases Working with Phases
1111 1256 subrepos Subrepositories
1112 1257 urls URL Paths
1113 1258
1114 1259 Commands:
1115 1260
1116 1261 bookmarks create a new bookmark or list existing bookmarks
1117 1262 clone make a copy of an existing repository
1118 1263 paths show aliases for remote repositories
1119 1264 update update working directory (or switch revisions)
1120 1265
1121 1266 Extensions:
1122 1267
1123 1268 clonebundles advertise pre-generated bundles to seed clones (experimental)
1124 1269 prefixedname matched against word "clone"
1125 1270 relink recreates hardlinks between repository clones
1126 1271
1127 1272 Extension Commands:
1128 1273
1129 1274 qclone clone main and patch repository at same time
1130 1275
1131 1276 Test unfound topic
1132 1277
1133 1278 $ hg help nonexistingtopicthatwillneverexisteverever
1134 1279 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1135 1280 (try "hg help --keyword nonexistingtopicthatwillneverexisteverever")
1136 1281 [255]
1137 1282
1138 1283 Test unfound keyword
1139 1284
1140 1285 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1141 1286 abort: no matches
1142 1287 (try "hg help" for a list of topics)
1143 1288 [255]
1144 1289
1145 1290 Test omit indicating for help
1146 1291
1147 1292 $ cat > addverboseitems.py <<EOF
1148 1293 > '''extension to test omit indicating.
1149 1294 >
1150 1295 > This paragraph is never omitted (for extension)
1151 1296 >
1152 1297 > .. container:: verbose
1153 1298 >
1154 1299 > This paragraph is omitted,
1155 1300 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1156 1301 >
1157 1302 > This paragraph is never omitted, too (for extension)
1158 1303 > '''
1159 1304 >
1160 1305 > from mercurial import help, commands
1161 1306 > testtopic = """This paragraph is never omitted (for topic).
1162 1307 >
1163 1308 > .. container:: verbose
1164 1309 >
1165 1310 > This paragraph is omitted,
1166 1311 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1167 1312 >
1168 1313 > This paragraph is never omitted, too (for topic)
1169 1314 > """
1170 1315 > def extsetup(ui):
1171 1316 > help.helptable.append((["topic-containing-verbose"],
1172 1317 > "This is the topic to test omit indicating.",
1173 1318 > lambda ui: testtopic))
1174 1319 > EOF
1175 1320 $ echo '[extensions]' >> $HGRCPATH
1176 1321 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1177 1322 $ hg help addverboseitems
1178 1323 addverboseitems extension - extension to test omit indicating.
1179 1324
1180 1325 This paragraph is never omitted (for extension)
1181 1326
1182 1327 This paragraph is never omitted, too (for extension)
1183 1328
1184 1329 (some details hidden, use --verbose to show complete help)
1185 1330
1186 1331 no commands defined
1187 1332 $ hg help -v addverboseitems
1188 1333 addverboseitems extension - extension to test omit indicating.
1189 1334
1190 1335 This paragraph is never omitted (for extension)
1191 1336
1192 1337 This paragraph is omitted, if "hg help" is invoked without "-v" (for
1193 1338 extension)
1194 1339
1195 1340 This paragraph is never omitted, too (for extension)
1196 1341
1197 1342 no commands defined
1198 1343 $ hg help topic-containing-verbose
1199 1344 This is the topic to test omit indicating.
1200 1345 """"""""""""""""""""""""""""""""""""""""""
1201 1346
1202 1347 This paragraph is never omitted (for topic).
1203 1348
1204 1349 This paragraph is never omitted, too (for topic)
1205 1350
1206 1351 (some details hidden, use --verbose to show complete help)
1207 1352 $ hg help -v topic-containing-verbose
1208 1353 This is the topic to test omit indicating.
1209 1354 """"""""""""""""""""""""""""""""""""""""""
1210 1355
1211 1356 This paragraph is never omitted (for topic).
1212 1357
1213 1358 This paragraph is omitted, if "hg help" is invoked without "-v" (for
1214 1359 topic)
1215 1360
1216 1361 This paragraph is never omitted, too (for topic)
1217 1362
1218 1363 Test section lookup
1219 1364
1220 1365 $ hg help revset.merge
1221 1366 "merge()"
1222 1367 Changeset is a merge changeset.
1223 1368
1224 1369 $ hg help glossary.dag
1225 1370 DAG
1226 1371 The repository of changesets of a distributed version control system
1227 1372 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1228 1373 of nodes and edges, where nodes correspond to changesets and edges
1229 1374 imply a parent -> child relation. This graph can be visualized by
1230 1375 graphical tools such as "hg log --graph". In Mercurial, the DAG is
1231 1376 limited by the requirement for children to have at most two parents.
1232 1377
1233 1378
1234 1379 $ hg help hgrc.paths
1235 1380 "paths"
1236 1381 -------
1237 1382
1238 1383 Assigns symbolic names and behavior to repositories.
1239 1384
1240 1385 Options are symbolic names defining the URL or directory that is the
1241 1386 location of the repository. Example:
1242 1387
1243 1388 [paths]
1244 1389 my_server = https://example.com/my_repo
1245 1390 local_path = /home/me/repo
1246 1391
1247 1392 These symbolic names can be used from the command line. To pull from
1248 1393 "my_server": "hg pull my_server". To push to "local_path": "hg push
1249 1394 local_path".
1250 1395
1251 1396 Options containing colons (":") denote sub-options that can influence
1252 1397 behavior for that specific path. Example:
1253 1398
1254 1399 [paths]
1255 1400 my_server = https://example.com/my_path
1256 1401 my_server:pushurl = ssh://example.com/my_path
1257 1402
1258 1403 The following sub-options can be defined:
1259 1404
1260 1405 "pushurl"
1261 1406 The URL to use for push operations. If not defined, the location
1262 1407 defined by the path's main entry is used.
1263 1408
1264 1409 The following special named paths exist:
1265 1410
1266 1411 "default"
1267 1412 The URL or directory to use when no source or remote is specified.
1268 1413
1269 1414 "hg clone" will automatically define this path to the location the
1270 1415 repository was cloned from.
1271 1416
1272 1417 "default-push"
1273 1418 (deprecated) The URL or directory for the default "hg push" location.
1274 1419 "default:pushurl" should be used instead.
1275 1420
1276 1421 $ hg help glossary.mcguffin
1277 1422 abort: help section not found
1278 1423 [255]
1279 1424
1280 1425 $ hg help glossary.mc.guffin
1281 1426 abort: help section not found
1282 1427 [255]
1283 1428
1284 1429 $ hg help template.files
1285 1430 files List of strings. All files modified, added, or removed by
1286 1431 this changeset.
1287 1432
1288 1433 Test dynamic list of merge tools only shows up once
1289 1434 $ hg help merge-tools
1290 1435 Merge Tools
1291 1436 """""""""""
1292 1437
1293 1438 To merge files Mercurial uses merge tools.
1294 1439
1295 1440 A merge tool combines two different versions of a file into a merged file.
1296 1441 Merge tools are given the two files and the greatest common ancestor of
1297 1442 the two file versions, so they can determine the changes made on both
1298 1443 branches.
1299 1444
1300 1445 Merge tools are used both for "hg resolve", "hg merge", "hg update", "hg
1301 1446 backout" and in several extensions.
1302 1447
1303 1448 Usually, the merge tool tries to automatically reconcile the files by
1304 1449 combining all non-overlapping changes that occurred separately in the two
1305 1450 different evolutions of the same initial base file. Furthermore, some
1306 1451 interactive merge programs make it easier to manually resolve conflicting
1307 1452 merges, either in a graphical way, or by inserting some conflict markers.
1308 1453 Mercurial does not include any interactive merge programs but relies on
1309 1454 external tools for that.
1310 1455
1311 1456 Available merge tools
1312 1457 =====================
1313 1458
1314 1459 External merge tools and their properties are configured in the merge-
1315 1460 tools configuration section - see hgrc(5) - but they can often just be
1316 1461 named by their executable.
1317 1462
1318 1463 A merge tool is generally usable if its executable can be found on the
1319 1464 system and if it can handle the merge. The executable is found if it is an
1320 1465 absolute or relative executable path or the name of an application in the
1321 1466 executable search path. The tool is assumed to be able to handle the merge
1322 1467 if it can handle symlinks if the file is a symlink, if it can handle
1323 1468 binary files if the file is binary, and if a GUI is available if the tool
1324 1469 requires a GUI.
1325 1470
1326 1471 There are some internal merge tools which can be used. The internal merge
1327 1472 tools are:
1328 1473
1329 1474 ":dump"
1330 1475 Creates three versions of the files to merge, containing the contents of
1331 1476 local, other and base. These files can then be used to perform a merge
1332 1477 manually. If the file to be merged is named "a.txt", these files will
1333 1478 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1334 1479 they will be placed in the same directory as "a.txt".
1335 1480
1336 1481 ":fail"
1337 1482 Rather than attempting to merge files that were modified on both
1338 1483 branches, it marks them as unresolved. The resolve command must be used
1339 1484 to resolve these conflicts.
1340 1485
1341 1486 ":local"
1342 1487 Uses the local version of files as the merged version.
1343 1488
1344 1489 ":merge"
1345 1490 Uses the internal non-interactive simple merge algorithm for merging
1346 1491 files. It will fail if there are any conflicts and leave markers in the
1347 1492 partially merged file. Markers will have two sections, one for each side
1348 1493 of merge.
1349 1494
1350 1495 ":merge-local"
1351 1496 Like :merge, but resolve all conflicts non-interactively in favor of the
1352 1497 local changes.
1353 1498
1354 1499 ":merge-other"
1355 1500 Like :merge, but resolve all conflicts non-interactively in favor of the
1356 1501 other changes.
1357 1502
1358 1503 ":merge3"
1359 1504 Uses the internal non-interactive simple merge algorithm for merging
1360 1505 files. It will fail if there are any conflicts and leave markers in the
1361 1506 partially merged file. Marker will have three sections, one from each
1362 1507 side of the merge and one for the base content.
1363 1508
1364 1509 ":other"
1365 1510 Uses the other version of files as the merged version.
1366 1511
1367 1512 ":prompt"
1368 1513 Asks the user which of the local or the other version to keep as the
1369 1514 merged version.
1370 1515
1371 1516 ":tagmerge"
1372 1517 Uses the internal tag merge algorithm (experimental).
1373 1518
1374 1519 ":union"
1375 1520 Uses the internal non-interactive simple merge algorithm for merging
1376 1521 files. It will use both left and right sides for conflict regions. No
1377 1522 markers are inserted.
1378 1523
1379 1524 Internal tools are always available and do not require a GUI but will by
1380 1525 default not handle symlinks or binary files.
1381 1526
1382 1527 Choosing a merge tool
1383 1528 =====================
1384 1529
1385 1530 Mercurial uses these rules when deciding which merge tool to use:
1386 1531
1387 1532 1. If a tool has been specified with the --tool option to merge or
1388 1533 resolve, it is used. If it is the name of a tool in the merge-tools
1389 1534 configuration, its configuration is used. Otherwise the specified tool
1390 1535 must be executable by the shell.
1391 1536 2. If the "HGMERGE" environment variable is present, its value is used and
1392 1537 must be executable by the shell.
1393 1538 3. If the filename of the file to be merged matches any of the patterns in
1394 1539 the merge-patterns configuration section, the first usable merge tool
1395 1540 corresponding to a matching pattern is used. Here, binary capabilities
1396 1541 of the merge tool are not considered.
1397 1542 4. If ui.merge is set it will be considered next. If the value is not the
1398 1543 name of a configured tool, the specified value is used and must be
1399 1544 executable by the shell. Otherwise the named tool is used if it is
1400 1545 usable.
1401 1546 5. If any usable merge tools are present in the merge-tools configuration
1402 1547 section, the one with the highest priority is used.
1403 1548 6. If a program named "hgmerge" can be found on the system, it is used -
1404 1549 but it will by default not be used for symlinks and binary files.
1405 1550 7. If the file to be merged is not binary and is not a symlink, then
1406 1551 internal ":merge" is used.
1407 1552 8. The merge of the file fails and must be resolved before commit.
1408 1553
1409 1554 Note:
1410 1555 After selecting a merge program, Mercurial will by default attempt to
1411 1556 merge the files using a simple merge algorithm first. Only if it
1412 1557 doesn't succeed because of conflicting changes Mercurial will actually
1413 1558 execute the merge program. Whether to use the simple merge algorithm
1414 1559 first can be controlled by the premerge setting of the merge tool.
1415 1560 Premerge is enabled by default unless the file is binary or a symlink.
1416 1561
1417 1562 See the merge-tools and ui sections of hgrc(5) for details on the
1418 1563 configuration of merge tools.
1419 1564
1420 1565 Test usage of section marks in help documents
1421 1566
1422 1567 $ cd "$TESTDIR"/../doc
1423 1568 $ python check-seclevel.py
1424 1569 $ cd $TESTTMP
1425 1570
1426 1571 #if serve
1427 1572
1428 1573 Test the help pages in hgweb.
1429 1574
1430 1575 Dish up an empty repo; serve it cold.
1431 1576
1432 1577 $ hg init "$TESTTMP/test"
1433 1578 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1434 1579 $ cat hg.pid >> $DAEMON_PIDS
1435 1580
1436 1581 $ get-with-headers.py 127.0.0.1:$HGPORT "help"
1437 1582 200 Script output follows
1438 1583
1439 1584 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1440 1585 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1441 1586 <head>
1442 1587 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1443 1588 <meta name="robots" content="index, nofollow" />
1444 1589 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1445 1590 <script type="text/javascript" src="/static/mercurial.js"></script>
1446 1591
1447 1592 <title>Help: Index</title>
1448 1593 </head>
1449 1594 <body>
1450 1595
1451 1596 <div class="container">
1452 1597 <div class="menu">
1453 1598 <div class="logo">
1454 1599 <a href="https://mercurial-scm.org/">
1455 1600 <img src="/static/hglogo.png" alt="mercurial" /></a>
1456 1601 </div>
1457 1602 <ul>
1458 1603 <li><a href="/shortlog">log</a></li>
1459 1604 <li><a href="/graph">graph</a></li>
1460 1605 <li><a href="/tags">tags</a></li>
1461 1606 <li><a href="/bookmarks">bookmarks</a></li>
1462 1607 <li><a href="/branches">branches</a></li>
1463 1608 </ul>
1464 1609 <ul>
1465 1610 <li class="active">help</li>
1466 1611 </ul>
1467 1612 </div>
1468 1613
1469 1614 <div class="main">
1470 1615 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1471 1616 <form class="search" action="/log">
1472 1617
1473 1618 <p><input name="rev" id="search1" type="text" size="30" /></p>
1474 1619 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1475 1620 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1476 1621 </form>
1477 1622 <table class="bigtable">
1478 1623 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
1479 1624
1480 1625 <tr><td>
1481 1626 <a href="/help/config">
1482 1627 config
1483 1628 </a>
1484 1629 </td><td>
1485 1630 Configuration Files
1486 1631 </td></tr>
1487 1632 <tr><td>
1488 1633 <a href="/help/dates">
1489 1634 dates
1490 1635 </a>
1491 1636 </td><td>
1492 1637 Date Formats
1493 1638 </td></tr>
1494 1639 <tr><td>
1495 1640 <a href="/help/diffs">
1496 1641 diffs
1497 1642 </a>
1498 1643 </td><td>
1499 1644 Diff Formats
1500 1645 </td></tr>
1501 1646 <tr><td>
1502 1647 <a href="/help/environment">
1503 1648 environment
1504 1649 </a>
1505 1650 </td><td>
1506 1651 Environment Variables
1507 1652 </td></tr>
1508 1653 <tr><td>
1509 1654 <a href="/help/extensions">
1510 1655 extensions
1511 1656 </a>
1512 1657 </td><td>
1513 1658 Using Additional Features
1514 1659 </td></tr>
1515 1660 <tr><td>
1516 1661 <a href="/help/filesets">
1517 1662 filesets
1518 1663 </a>
1519 1664 </td><td>
1520 1665 Specifying File Sets
1521 1666 </td></tr>
1522 1667 <tr><td>
1523 1668 <a href="/help/glossary">
1524 1669 glossary
1525 1670 </a>
1526 1671 </td><td>
1527 1672 Glossary
1528 1673 </td></tr>
1529 1674 <tr><td>
1530 1675 <a href="/help/hgignore">
1531 1676 hgignore
1532 1677 </a>
1533 1678 </td><td>
1534 1679 Syntax for Mercurial Ignore Files
1535 1680 </td></tr>
1536 1681 <tr><td>
1537 1682 <a href="/help/hgweb">
1538 1683 hgweb
1539 1684 </a>
1540 1685 </td><td>
1541 1686 Configuring hgweb
1542 1687 </td></tr>
1543 1688 <tr><td>
1544 1689 <a href="/help/internals">
1545 1690 internals
1546 1691 </a>
1547 1692 </td><td>
1548 1693 Technical implementation topics
1549 1694 </td></tr>
1550 1695 <tr><td>
1551 1696 <a href="/help/merge-tools">
1552 1697 merge-tools
1553 1698 </a>
1554 1699 </td><td>
1555 1700 Merge Tools
1556 1701 </td></tr>
1557 1702 <tr><td>
1558 1703 <a href="/help/multirevs">
1559 1704 multirevs
1560 1705 </a>
1561 1706 </td><td>
1562 1707 Specifying Multiple Revisions
1563 1708 </td></tr>
1564 1709 <tr><td>
1565 1710 <a href="/help/patterns">
1566 1711 patterns
1567 1712 </a>
1568 1713 </td><td>
1569 1714 File Name Patterns
1570 1715 </td></tr>
1571 1716 <tr><td>
1572 1717 <a href="/help/phases">
1573 1718 phases
1574 1719 </a>
1575 1720 </td><td>
1576 1721 Working with Phases
1577 1722 </td></tr>
1578 1723 <tr><td>
1579 1724 <a href="/help/revisions">
1580 1725 revisions
1581 1726 </a>
1582 1727 </td><td>
1583 1728 Specifying Single Revisions
1584 1729 </td></tr>
1585 1730 <tr><td>
1586 1731 <a href="/help/revsets">
1587 1732 revsets
1588 1733 </a>
1589 1734 </td><td>
1590 1735 Specifying Revision Sets
1591 1736 </td></tr>
1592 1737 <tr><td>
1593 1738 <a href="/help/scripting">
1594 1739 scripting
1595 1740 </a>
1596 1741 </td><td>
1597 1742 Using Mercurial from scripts and automation
1598 1743 </td></tr>
1599 1744 <tr><td>
1600 1745 <a href="/help/subrepos">
1601 1746 subrepos
1602 1747 </a>
1603 1748 </td><td>
1604 1749 Subrepositories
1605 1750 </td></tr>
1606 1751 <tr><td>
1607 1752 <a href="/help/templating">
1608 1753 templating
1609 1754 </a>
1610 1755 </td><td>
1611 1756 Template Usage
1612 1757 </td></tr>
1613 1758 <tr><td>
1614 1759 <a href="/help/urls">
1615 1760 urls
1616 1761 </a>
1617 1762 </td><td>
1618 1763 URL Paths
1619 1764 </td></tr>
1620 1765 <tr><td>
1621 1766 <a href="/help/topic-containing-verbose">
1622 1767 topic-containing-verbose
1623 1768 </a>
1624 1769 </td><td>
1625 1770 This is the topic to test omit indicating.
1626 1771 </td></tr>
1627 1772
1628 1773 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1629 1774
1630 1775 <tr><td>
1631 1776 <a href="/help/add">
1632 1777 add
1633 1778 </a>
1634 1779 </td><td>
1635 1780 add the specified files on the next commit
1636 1781 </td></tr>
1637 1782 <tr><td>
1638 1783 <a href="/help/annotate">
1639 1784 annotate
1640 1785 </a>
1641 1786 </td><td>
1642 1787 show changeset information by line for each file
1643 1788 </td></tr>
1644 1789 <tr><td>
1645 1790 <a href="/help/clone">
1646 1791 clone
1647 1792 </a>
1648 1793 </td><td>
1649 1794 make a copy of an existing repository
1650 1795 </td></tr>
1651 1796 <tr><td>
1652 1797 <a href="/help/commit">
1653 1798 commit
1654 1799 </a>
1655 1800 </td><td>
1656 1801 commit the specified files or all outstanding changes
1657 1802 </td></tr>
1658 1803 <tr><td>
1659 1804 <a href="/help/diff">
1660 1805 diff
1661 1806 </a>
1662 1807 </td><td>
1663 1808 diff repository (or selected files)
1664 1809 </td></tr>
1665 1810 <tr><td>
1666 1811 <a href="/help/export">
1667 1812 export
1668 1813 </a>
1669 1814 </td><td>
1670 1815 dump the header and diffs for one or more changesets
1671 1816 </td></tr>
1672 1817 <tr><td>
1673 1818 <a href="/help/forget">
1674 1819 forget
1675 1820 </a>
1676 1821 </td><td>
1677 1822 forget the specified files on the next commit
1678 1823 </td></tr>
1679 1824 <tr><td>
1680 1825 <a href="/help/init">
1681 1826 init
1682 1827 </a>
1683 1828 </td><td>
1684 1829 create a new repository in the given directory
1685 1830 </td></tr>
1686 1831 <tr><td>
1687 1832 <a href="/help/log">
1688 1833 log
1689 1834 </a>
1690 1835 </td><td>
1691 1836 show revision history of entire repository or files
1692 1837 </td></tr>
1693 1838 <tr><td>
1694 1839 <a href="/help/merge">
1695 1840 merge
1696 1841 </a>
1697 1842 </td><td>
1698 1843 merge another revision into working directory
1699 1844 </td></tr>
1700 1845 <tr><td>
1701 1846 <a href="/help/pull">
1702 1847 pull
1703 1848 </a>
1704 1849 </td><td>
1705 1850 pull changes from the specified source
1706 1851 </td></tr>
1707 1852 <tr><td>
1708 1853 <a href="/help/push">
1709 1854 push
1710 1855 </a>
1711 1856 </td><td>
1712 1857 push changes to the specified destination
1713 1858 </td></tr>
1714 1859 <tr><td>
1715 1860 <a href="/help/remove">
1716 1861 remove
1717 1862 </a>
1718 1863 </td><td>
1719 1864 remove the specified files on the next commit
1720 1865 </td></tr>
1721 1866 <tr><td>
1722 1867 <a href="/help/serve">
1723 1868 serve
1724 1869 </a>
1725 1870 </td><td>
1726 1871 start stand-alone webserver
1727 1872 </td></tr>
1728 1873 <tr><td>
1729 1874 <a href="/help/status">
1730 1875 status
1731 1876 </a>
1732 1877 </td><td>
1733 1878 show changed files in the working directory
1734 1879 </td></tr>
1735 1880 <tr><td>
1736 1881 <a href="/help/summary">
1737 1882 summary
1738 1883 </a>
1739 1884 </td><td>
1740 1885 summarize working directory state
1741 1886 </td></tr>
1742 1887 <tr><td>
1743 1888 <a href="/help/update">
1744 1889 update
1745 1890 </a>
1746 1891 </td><td>
1747 1892 update working directory (or switch revisions)
1748 1893 </td></tr>
1749 1894
1750 1895 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1751 1896
1752 1897 <tr><td>
1753 1898 <a href="/help/addremove">
1754 1899 addremove
1755 1900 </a>
1756 1901 </td><td>
1757 1902 add all new files, delete all missing files
1758 1903 </td></tr>
1759 1904 <tr><td>
1760 1905 <a href="/help/archive">
1761 1906 archive
1762 1907 </a>
1763 1908 </td><td>
1764 1909 create an unversioned archive of a repository revision
1765 1910 </td></tr>
1766 1911 <tr><td>
1767 1912 <a href="/help/backout">
1768 1913 backout
1769 1914 </a>
1770 1915 </td><td>
1771 1916 reverse effect of earlier changeset
1772 1917 </td></tr>
1773 1918 <tr><td>
1774 1919 <a href="/help/bisect">
1775 1920 bisect
1776 1921 </a>
1777 1922 </td><td>
1778 1923 subdivision search of changesets
1779 1924 </td></tr>
1780 1925 <tr><td>
1781 1926 <a href="/help/bookmarks">
1782 1927 bookmarks
1783 1928 </a>
1784 1929 </td><td>
1785 1930 create a new bookmark or list existing bookmarks
1786 1931 </td></tr>
1787 1932 <tr><td>
1788 1933 <a href="/help/branch">
1789 1934 branch
1790 1935 </a>
1791 1936 </td><td>
1792 1937 set or show the current branch name
1793 1938 </td></tr>
1794 1939 <tr><td>
1795 1940 <a href="/help/branches">
1796 1941 branches
1797 1942 </a>
1798 1943 </td><td>
1799 1944 list repository named branches
1800 1945 </td></tr>
1801 1946 <tr><td>
1802 1947 <a href="/help/bundle">
1803 1948 bundle
1804 1949 </a>
1805 1950 </td><td>
1806 1951 create a changegroup file
1807 1952 </td></tr>
1808 1953 <tr><td>
1809 1954 <a href="/help/cat">
1810 1955 cat
1811 1956 </a>
1812 1957 </td><td>
1813 1958 output the current or given revision of files
1814 1959 </td></tr>
1815 1960 <tr><td>
1816 1961 <a href="/help/config">
1817 1962 config
1818 1963 </a>
1819 1964 </td><td>
1820 1965 show combined config settings from all hgrc files
1821 1966 </td></tr>
1822 1967 <tr><td>
1823 1968 <a href="/help/copy">
1824 1969 copy
1825 1970 </a>
1826 1971 </td><td>
1827 1972 mark files as copied for the next commit
1828 1973 </td></tr>
1829 1974 <tr><td>
1830 1975 <a href="/help/files">
1831 1976 files
1832 1977 </a>
1833 1978 </td><td>
1834 1979 list tracked files
1835 1980 </td></tr>
1836 1981 <tr><td>
1837 1982 <a href="/help/graft">
1838 1983 graft
1839 1984 </a>
1840 1985 </td><td>
1841 1986 copy changes from other branches onto the current branch
1842 1987 </td></tr>
1843 1988 <tr><td>
1844 1989 <a href="/help/grep">
1845 1990 grep
1846 1991 </a>
1847 1992 </td><td>
1848 1993 search for a pattern in specified files and revisions
1849 1994 </td></tr>
1850 1995 <tr><td>
1851 1996 <a href="/help/heads">
1852 1997 heads
1853 1998 </a>
1854 1999 </td><td>
1855 2000 show branch heads
1856 2001 </td></tr>
1857 2002 <tr><td>
1858 2003 <a href="/help/help">
1859 2004 help
1860 2005 </a>
1861 2006 </td><td>
1862 2007 show help for a given topic or a help overview
1863 2008 </td></tr>
1864 2009 <tr><td>
1865 2010 <a href="/help/identify">
1866 2011 identify
1867 2012 </a>
1868 2013 </td><td>
1869 2014 identify the working directory or specified revision
1870 2015 </td></tr>
1871 2016 <tr><td>
1872 2017 <a href="/help/import">
1873 2018 import
1874 2019 </a>
1875 2020 </td><td>
1876 2021 import an ordered set of patches
1877 2022 </td></tr>
1878 2023 <tr><td>
1879 2024 <a href="/help/incoming">
1880 2025 incoming
1881 2026 </a>
1882 2027 </td><td>
1883 2028 show new changesets found in source
1884 2029 </td></tr>
1885 2030 <tr><td>
1886 2031 <a href="/help/manifest">
1887 2032 manifest
1888 2033 </a>
1889 2034 </td><td>
1890 2035 output the current or given revision of the project manifest
1891 2036 </td></tr>
1892 2037 <tr><td>
1893 2038 <a href="/help/nohelp">
1894 2039 nohelp
1895 2040 </a>
1896 2041 </td><td>
1897 2042 (no help text available)
1898 2043 </td></tr>
1899 2044 <tr><td>
1900 2045 <a href="/help/outgoing">
1901 2046 outgoing
1902 2047 </a>
1903 2048 </td><td>
1904 2049 show changesets not found in the destination
1905 2050 </td></tr>
1906 2051 <tr><td>
1907 2052 <a href="/help/paths">
1908 2053 paths
1909 2054 </a>
1910 2055 </td><td>
1911 2056 show aliases for remote repositories
1912 2057 </td></tr>
1913 2058 <tr><td>
1914 2059 <a href="/help/phase">
1915 2060 phase
1916 2061 </a>
1917 2062 </td><td>
1918 2063 set or show the current phase name
1919 2064 </td></tr>
1920 2065 <tr><td>
1921 2066 <a href="/help/recover">
1922 2067 recover
1923 2068 </a>
1924 2069 </td><td>
1925 2070 roll back an interrupted transaction
1926 2071 </td></tr>
1927 2072 <tr><td>
1928 2073 <a href="/help/rename">
1929 2074 rename
1930 2075 </a>
1931 2076 </td><td>
1932 2077 rename files; equivalent of copy + remove
1933 2078 </td></tr>
1934 2079 <tr><td>
1935 2080 <a href="/help/resolve">
1936 2081 resolve
1937 2082 </a>
1938 2083 </td><td>
1939 2084 redo merges or set/view the merge status of files
1940 2085 </td></tr>
1941 2086 <tr><td>
1942 2087 <a href="/help/revert">
1943 2088 revert
1944 2089 </a>
1945 2090 </td><td>
1946 2091 restore files to their checkout state
1947 2092 </td></tr>
1948 2093 <tr><td>
1949 2094 <a href="/help/root">
1950 2095 root
1951 2096 </a>
1952 2097 </td><td>
1953 2098 print the root (top) of the current working directory
1954 2099 </td></tr>
1955 2100 <tr><td>
1956 2101 <a href="/help/tag">
1957 2102 tag
1958 2103 </a>
1959 2104 </td><td>
1960 2105 add one or more tags for the current or given revision
1961 2106 </td></tr>
1962 2107 <tr><td>
1963 2108 <a href="/help/tags">
1964 2109 tags
1965 2110 </a>
1966 2111 </td><td>
1967 2112 list repository tags
1968 2113 </td></tr>
1969 2114 <tr><td>
1970 2115 <a href="/help/unbundle">
1971 2116 unbundle
1972 2117 </a>
1973 2118 </td><td>
1974 2119 apply one or more changegroup files
1975 2120 </td></tr>
1976 2121 <tr><td>
1977 2122 <a href="/help/verify">
1978 2123 verify
1979 2124 </a>
1980 2125 </td><td>
1981 2126 verify the integrity of the repository
1982 2127 </td></tr>
1983 2128 <tr><td>
1984 2129 <a href="/help/version">
1985 2130 version
1986 2131 </a>
1987 2132 </td><td>
1988 2133 output version and copyright information
1989 2134 </td></tr>
1990 2135 </table>
1991 2136 </div>
1992 2137 </div>
1993 2138
1994 2139 <script type="text/javascript">process_dates()</script>
1995 2140
1996 2141
1997 2142 </body>
1998 2143 </html>
1999 2144
2000 2145
2001 2146 $ get-with-headers.py 127.0.0.1:$HGPORT "help/add"
2002 2147 200 Script output follows
2003 2148
2004 2149 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2005 2150 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2006 2151 <head>
2007 2152 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2008 2153 <meta name="robots" content="index, nofollow" />
2009 2154 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2010 2155 <script type="text/javascript" src="/static/mercurial.js"></script>
2011 2156
2012 2157 <title>Help: add</title>
2013 2158 </head>
2014 2159 <body>
2015 2160
2016 2161 <div class="container">
2017 2162 <div class="menu">
2018 2163 <div class="logo">
2019 2164 <a href="https://mercurial-scm.org/">
2020 2165 <img src="/static/hglogo.png" alt="mercurial" /></a>
2021 2166 </div>
2022 2167 <ul>
2023 2168 <li><a href="/shortlog">log</a></li>
2024 2169 <li><a href="/graph">graph</a></li>
2025 2170 <li><a href="/tags">tags</a></li>
2026 2171 <li><a href="/bookmarks">bookmarks</a></li>
2027 2172 <li><a href="/branches">branches</a></li>
2028 2173 </ul>
2029 2174 <ul>
2030 2175 <li class="active"><a href="/help">help</a></li>
2031 2176 </ul>
2032 2177 </div>
2033 2178
2034 2179 <div class="main">
2035 2180 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2036 2181 <h3>Help: add</h3>
2037 2182
2038 2183 <form class="search" action="/log">
2039 2184
2040 2185 <p><input name="rev" id="search1" type="text" size="30" /></p>
2041 2186 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2042 2187 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2043 2188 </form>
2044 2189 <div id="doc">
2045 2190 <p>
2046 2191 hg add [OPTION]... [FILE]...
2047 2192 </p>
2048 2193 <p>
2049 2194 add the specified files on the next commit
2050 2195 </p>
2051 2196 <p>
2052 2197 Schedule files to be version controlled and added to the
2053 2198 repository.
2054 2199 </p>
2055 2200 <p>
2056 2201 The files will be added to the repository at the next commit. To
2057 2202 undo an add before that, see &quot;hg forget&quot;.
2058 2203 </p>
2059 2204 <p>
2060 2205 If no names are given, add all files to the repository.
2061 2206 </p>
2062 2207 <p>
2063 2208 Examples:
2064 2209 </p>
2065 2210 <ul>
2066 2211 <li> New (unknown) files are added automatically by &quot;hg add&quot;:
2067 2212 <pre>
2068 2213 \$ ls (re)
2069 2214 foo.c
2070 2215 \$ hg status (re)
2071 2216 ? foo.c
2072 2217 \$ hg add (re)
2073 2218 adding foo.c
2074 2219 \$ hg status (re)
2075 2220 A foo.c
2076 2221 </pre>
2077 2222 <li> Specific files to be added can be specified:
2078 2223 <pre>
2079 2224 \$ ls (re)
2080 2225 bar.c foo.c
2081 2226 \$ hg status (re)
2082 2227 ? bar.c
2083 2228 ? foo.c
2084 2229 \$ hg add bar.c (re)
2085 2230 \$ hg status (re)
2086 2231 A bar.c
2087 2232 ? foo.c
2088 2233 </pre>
2089 2234 </ul>
2090 2235 <p>
2091 2236 Returns 0 if all files are successfully added.
2092 2237 </p>
2093 2238 <p>
2094 2239 options ([+] can be repeated):
2095 2240 </p>
2096 2241 <table>
2097 2242 <tr><td>-I</td>
2098 2243 <td>--include PATTERN [+]</td>
2099 2244 <td>include names matching the given patterns</td></tr>
2100 2245 <tr><td>-X</td>
2101 2246 <td>--exclude PATTERN [+]</td>
2102 2247 <td>exclude names matching the given patterns</td></tr>
2103 2248 <tr><td>-S</td>
2104 2249 <td>--subrepos</td>
2105 2250 <td>recurse into subrepositories</td></tr>
2106 2251 <tr><td>-n</td>
2107 2252 <td>--dry-run</td>
2108 2253 <td>do not perform actions, just print output</td></tr>
2109 2254 </table>
2110 2255 <p>
2111 2256 global options ([+] can be repeated):
2112 2257 </p>
2113 2258 <table>
2114 2259 <tr><td>-R</td>
2115 2260 <td>--repository REPO</td>
2116 2261 <td>repository root directory or name of overlay bundle file</td></tr>
2117 2262 <tr><td></td>
2118 2263 <td>--cwd DIR</td>
2119 2264 <td>change working directory</td></tr>
2120 2265 <tr><td>-y</td>
2121 2266 <td>--noninteractive</td>
2122 2267 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2123 2268 <tr><td>-q</td>
2124 2269 <td>--quiet</td>
2125 2270 <td>suppress output</td></tr>
2126 2271 <tr><td>-v</td>
2127 2272 <td>--verbose</td>
2128 2273 <td>enable additional output</td></tr>
2129 2274 <tr><td></td>
2130 2275 <td>--config CONFIG [+]</td>
2131 2276 <td>set/override config option (use 'section.name=value')</td></tr>
2132 2277 <tr><td></td>
2133 2278 <td>--debug</td>
2134 2279 <td>enable debugging output</td></tr>
2135 2280 <tr><td></td>
2136 2281 <td>--debugger</td>
2137 2282 <td>start debugger</td></tr>
2138 2283 <tr><td></td>
2139 2284 <td>--encoding ENCODE</td>
2140 2285 <td>set the charset encoding (default: ascii)</td></tr>
2141 2286 <tr><td></td>
2142 2287 <td>--encodingmode MODE</td>
2143 2288 <td>set the charset encoding mode (default: strict)</td></tr>
2144 2289 <tr><td></td>
2145 2290 <td>--traceback</td>
2146 2291 <td>always print a traceback on exception</td></tr>
2147 2292 <tr><td></td>
2148 2293 <td>--time</td>
2149 2294 <td>time how long the command takes</td></tr>
2150 2295 <tr><td></td>
2151 2296 <td>--profile</td>
2152 2297 <td>print command execution profile</td></tr>
2153 2298 <tr><td></td>
2154 2299 <td>--version</td>
2155 2300 <td>output version information and exit</td></tr>
2156 2301 <tr><td>-h</td>
2157 2302 <td>--help</td>
2158 2303 <td>display help and exit</td></tr>
2159 2304 <tr><td></td>
2160 2305 <td>--hidden</td>
2161 2306 <td>consider hidden changesets</td></tr>
2162 2307 </table>
2163 2308
2164 2309 </div>
2165 2310 </div>
2166 2311 </div>
2167 2312
2168 2313 <script type="text/javascript">process_dates()</script>
2169 2314
2170 2315
2171 2316 </body>
2172 2317 </html>
2173 2318
2174 2319
2175 2320 $ get-with-headers.py 127.0.0.1:$HGPORT "help/remove"
2176 2321 200 Script output follows
2177 2322
2178 2323 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2179 2324 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2180 2325 <head>
2181 2326 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2182 2327 <meta name="robots" content="index, nofollow" />
2183 2328 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2184 2329 <script type="text/javascript" src="/static/mercurial.js"></script>
2185 2330
2186 2331 <title>Help: remove</title>
2187 2332 </head>
2188 2333 <body>
2189 2334
2190 2335 <div class="container">
2191 2336 <div class="menu">
2192 2337 <div class="logo">
2193 2338 <a href="https://mercurial-scm.org/">
2194 2339 <img src="/static/hglogo.png" alt="mercurial" /></a>
2195 2340 </div>
2196 2341 <ul>
2197 2342 <li><a href="/shortlog">log</a></li>
2198 2343 <li><a href="/graph">graph</a></li>
2199 2344 <li><a href="/tags">tags</a></li>
2200 2345 <li><a href="/bookmarks">bookmarks</a></li>
2201 2346 <li><a href="/branches">branches</a></li>
2202 2347 </ul>
2203 2348 <ul>
2204 2349 <li class="active"><a href="/help">help</a></li>
2205 2350 </ul>
2206 2351 </div>
2207 2352
2208 2353 <div class="main">
2209 2354 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2210 2355 <h3>Help: remove</h3>
2211 2356
2212 2357 <form class="search" action="/log">
2213 2358
2214 2359 <p><input name="rev" id="search1" type="text" size="30" /></p>
2215 2360 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2216 2361 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2217 2362 </form>
2218 2363 <div id="doc">
2219 2364 <p>
2220 2365 hg remove [OPTION]... FILE...
2221 2366 </p>
2222 2367 <p>
2223 2368 aliases: rm
2224 2369 </p>
2225 2370 <p>
2226 2371 remove the specified files on the next commit
2227 2372 </p>
2228 2373 <p>
2229 2374 Schedule the indicated files for removal from the current branch.
2230 2375 </p>
2231 2376 <p>
2232 2377 This command schedules the files to be removed at the next commit.
2233 2378 To undo a remove before that, see &quot;hg revert&quot;. To undo added
2234 2379 files, see &quot;hg forget&quot;.
2235 2380 </p>
2236 2381 <p>
2237 2382 -A/--after can be used to remove only files that have already
2238 2383 been deleted, -f/--force can be used to force deletion, and -Af
2239 2384 can be used to remove files from the next revision without
2240 2385 deleting them from the working directory.
2241 2386 </p>
2242 2387 <p>
2243 2388 The following table details the behavior of remove for different
2244 2389 file states (columns) and option combinations (rows). The file
2245 2390 states are Added [A], Clean [C], Modified [M] and Missing [!]
2246 2391 (as reported by &quot;hg status&quot;). The actions are Warn, Remove
2247 2392 (from branch) and Delete (from disk):
2248 2393 </p>
2249 2394 <table>
2250 2395 <tr><td>opt/state</td>
2251 2396 <td>A</td>
2252 2397 <td>C</td>
2253 2398 <td>M</td>
2254 2399 <td>!</td></tr>
2255 2400 <tr><td>none</td>
2256 2401 <td>W</td>
2257 2402 <td>RD</td>
2258 2403 <td>W</td>
2259 2404 <td>R</td></tr>
2260 2405 <tr><td>-f</td>
2261 2406 <td>R</td>
2262 2407 <td>RD</td>
2263 2408 <td>RD</td>
2264 2409 <td>R</td></tr>
2265 2410 <tr><td>-A</td>
2266 2411 <td>W</td>
2267 2412 <td>W</td>
2268 2413 <td>W</td>
2269 2414 <td>R</td></tr>
2270 2415 <tr><td>-Af</td>
2271 2416 <td>R</td>
2272 2417 <td>R</td>
2273 2418 <td>R</td>
2274 2419 <td>R</td></tr>
2275 2420 </table>
2276 2421 <p>
2277 2422 Note that remove never deletes files in Added [A] state from the
2278 2423 working directory, not even if option --force is specified.
2279 2424 </p>
2280 2425 <p>
2281 2426 Returns 0 on success, 1 if any warnings encountered.
2282 2427 </p>
2283 2428 <p>
2284 2429 options ([+] can be repeated):
2285 2430 </p>
2286 2431 <table>
2287 2432 <tr><td>-A</td>
2288 2433 <td>--after</td>
2289 2434 <td>record delete for missing files</td></tr>
2290 2435 <tr><td>-f</td>
2291 2436 <td>--force</td>
2292 2437 <td>remove (and delete) file even if added or modified</td></tr>
2293 2438 <tr><td>-S</td>
2294 2439 <td>--subrepos</td>
2295 2440 <td>recurse into subrepositories</td></tr>
2296 2441 <tr><td>-I</td>
2297 2442 <td>--include PATTERN [+]</td>
2298 2443 <td>include names matching the given patterns</td></tr>
2299 2444 <tr><td>-X</td>
2300 2445 <td>--exclude PATTERN [+]</td>
2301 2446 <td>exclude names matching the given patterns</td></tr>
2302 2447 </table>
2303 2448 <p>
2304 2449 global options ([+] can be repeated):
2305 2450 </p>
2306 2451 <table>
2307 2452 <tr><td>-R</td>
2308 2453 <td>--repository REPO</td>
2309 2454 <td>repository root directory or name of overlay bundle file</td></tr>
2310 2455 <tr><td></td>
2311 2456 <td>--cwd DIR</td>
2312 2457 <td>change working directory</td></tr>
2313 2458 <tr><td>-y</td>
2314 2459 <td>--noninteractive</td>
2315 2460 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2316 2461 <tr><td>-q</td>
2317 2462 <td>--quiet</td>
2318 2463 <td>suppress output</td></tr>
2319 2464 <tr><td>-v</td>
2320 2465 <td>--verbose</td>
2321 2466 <td>enable additional output</td></tr>
2322 2467 <tr><td></td>
2323 2468 <td>--config CONFIG [+]</td>
2324 2469 <td>set/override config option (use 'section.name=value')</td></tr>
2325 2470 <tr><td></td>
2326 2471 <td>--debug</td>
2327 2472 <td>enable debugging output</td></tr>
2328 2473 <tr><td></td>
2329 2474 <td>--debugger</td>
2330 2475 <td>start debugger</td></tr>
2331 2476 <tr><td></td>
2332 2477 <td>--encoding ENCODE</td>
2333 2478 <td>set the charset encoding (default: ascii)</td></tr>
2334 2479 <tr><td></td>
2335 2480 <td>--encodingmode MODE</td>
2336 2481 <td>set the charset encoding mode (default: strict)</td></tr>
2337 2482 <tr><td></td>
2338 2483 <td>--traceback</td>
2339 2484 <td>always print a traceback on exception</td></tr>
2340 2485 <tr><td></td>
2341 2486 <td>--time</td>
2342 2487 <td>time how long the command takes</td></tr>
2343 2488 <tr><td></td>
2344 2489 <td>--profile</td>
2345 2490 <td>print command execution profile</td></tr>
2346 2491 <tr><td></td>
2347 2492 <td>--version</td>
2348 2493 <td>output version information and exit</td></tr>
2349 2494 <tr><td>-h</td>
2350 2495 <td>--help</td>
2351 2496 <td>display help and exit</td></tr>
2352 2497 <tr><td></td>
2353 2498 <td>--hidden</td>
2354 2499 <td>consider hidden changesets</td></tr>
2355 2500 </table>
2356 2501
2357 2502 </div>
2358 2503 </div>
2359 2504 </div>
2360 2505
2361 2506 <script type="text/javascript">process_dates()</script>
2362 2507
2363 2508
2364 2509 </body>
2365 2510 </html>
2366 2511
2367 2512
2368 2513 $ get-with-headers.py 127.0.0.1:$HGPORT "help/revisions"
2369 2514 200 Script output follows
2370 2515
2371 2516 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2372 2517 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2373 2518 <head>
2374 2519 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2375 2520 <meta name="robots" content="index, nofollow" />
2376 2521 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2377 2522 <script type="text/javascript" src="/static/mercurial.js"></script>
2378 2523
2379 2524 <title>Help: revisions</title>
2380 2525 </head>
2381 2526 <body>
2382 2527
2383 2528 <div class="container">
2384 2529 <div class="menu">
2385 2530 <div class="logo">
2386 2531 <a href="https://mercurial-scm.org/">
2387 2532 <img src="/static/hglogo.png" alt="mercurial" /></a>
2388 2533 </div>
2389 2534 <ul>
2390 2535 <li><a href="/shortlog">log</a></li>
2391 2536 <li><a href="/graph">graph</a></li>
2392 2537 <li><a href="/tags">tags</a></li>
2393 2538 <li><a href="/bookmarks">bookmarks</a></li>
2394 2539 <li><a href="/branches">branches</a></li>
2395 2540 </ul>
2396 2541 <ul>
2397 2542 <li class="active"><a href="/help">help</a></li>
2398 2543 </ul>
2399 2544 </div>
2400 2545
2401 2546 <div class="main">
2402 2547 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2403 2548 <h3>Help: revisions</h3>
2404 2549
2405 2550 <form class="search" action="/log">
2406 2551
2407 2552 <p><input name="rev" id="search1" type="text" size="30" /></p>
2408 2553 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2409 2554 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2410 2555 </form>
2411 2556 <div id="doc">
2412 2557 <h1>Specifying Single Revisions</h1>
2413 2558 <p>
2414 2559 Mercurial supports several ways to specify individual revisions.
2415 2560 </p>
2416 2561 <p>
2417 2562 A plain integer is treated as a revision number. Negative integers are
2418 2563 treated as sequential offsets from the tip, with -1 denoting the tip,
2419 2564 -2 denoting the revision prior to the tip, and so forth.
2420 2565 </p>
2421 2566 <p>
2422 2567 A 40-digit hexadecimal string is treated as a unique revision
2423 2568 identifier.
2424 2569 </p>
2425 2570 <p>
2426 2571 A hexadecimal string less than 40 characters long is treated as a
2427 2572 unique revision identifier and is referred to as a short-form
2428 2573 identifier. A short-form identifier is only valid if it is the prefix
2429 2574 of exactly one full-length identifier.
2430 2575 </p>
2431 2576 <p>
2432 2577 Any other string is treated as a bookmark, tag, or branch name. A
2433 2578 bookmark is a movable pointer to a revision. A tag is a permanent name
2434 2579 associated with a revision. A branch name denotes the tipmost open branch head
2435 2580 of that branch - or if they are all closed, the tipmost closed head of the
2436 2581 branch. Bookmark, tag, and branch names must not contain the &quot;:&quot; character.
2437 2582 </p>
2438 2583 <p>
2439 2584 The reserved name &quot;tip&quot; always identifies the most recent revision.
2440 2585 </p>
2441 2586 <p>
2442 2587 The reserved name &quot;null&quot; indicates the null revision. This is the
2443 2588 revision of an empty repository, and the parent of revision 0.
2444 2589 </p>
2445 2590 <p>
2446 2591 The reserved name &quot;.&quot; indicates the working directory parent. If no
2447 2592 working directory is checked out, it is equivalent to null. If an
2448 2593 uncommitted merge is in progress, &quot;.&quot; is the revision of the first
2449 2594 parent.
2450 2595 </p>
2451 2596
2452 2597 </div>
2453 2598 </div>
2454 2599 </div>
2455 2600
2456 2601 <script type="text/javascript">process_dates()</script>
2457 2602
2458 2603
2459 2604 </body>
2460 2605 </html>
2461 2606
2462 2607
2463 2608 $ killdaemons.py
2464 2609
2465 2610 #endif
General Comments 0
You need to be logged in to leave comments. Login now