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