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