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