##// END OF EJS Templates
help: filter out deprecated options with untranslated descriptions...
Simon Heimberg -
r20743:05267e6e default
parent child Browse files
Show More
@@ -1,509 +1,509 b''
1 1 # help.py - help data for mercurial
2 2 #
3 3 # Copyright 2006 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from i18n import gettext, _
9 9 import itertools, 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 if _("DEPRECATED") in desc and not verbose:
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 314 else:
315 315 header = _('list of commands:\n\n')
316 316
317 317 h = {}
318 318 cmds = {}
319 319 for c, e in commands.table.iteritems():
320 320 f = c.split("|", 1)[0]
321 321 if select and not select(f):
322 322 continue
323 323 if (not select and name != 'shortlist' and
324 324 e[0].__module__ != commands.__name__):
325 325 continue
326 326 if name == "shortlist" and not f.startswith("^"):
327 327 continue
328 328 f = f.lstrip("^")
329 329 if not ui.debugflag and f.startswith("debug"):
330 330 continue
331 331 doc = e[0].__doc__
332 332 if doc and 'DEPRECATED' in doc and not ui.verbose:
333 333 continue
334 334 doc = gettext(doc)
335 335 if not doc:
336 336 doc = _("(no help text available)")
337 337 h[f] = doc.splitlines()[0].rstrip()
338 338 cmds[f] = c.lstrip("^")
339 339
340 340 rst = []
341 341 if not h:
342 342 if not ui.quiet:
343 343 rst.append(_('no commands defined\n'))
344 344 return rst
345 345
346 346 if not ui.quiet:
347 347 rst.append(header)
348 348 fns = sorted(h)
349 349 for f in fns:
350 350 if ui.verbose:
351 351 commacmds = cmds[f].replace("|",", ")
352 352 rst.append(" :%s: %s\n" % (commacmds, h[f]))
353 353 else:
354 354 rst.append(' :%s: %s\n' % (f, h[f]))
355 355
356 356 if not name:
357 357 exts = listexts(_('enabled extensions:'), extensions.enabled())
358 358 if exts:
359 359 rst.append('\n')
360 360 rst.extend(exts)
361 361
362 362 rst.append(_("\nadditional help topics:\n\n"))
363 363 topics = []
364 364 for names, header, doc in helptable:
365 365 topics.append((names[0], header))
366 366 for t, desc in topics:
367 367 rst.append(" :%s: %s\n" % (t, desc))
368 368
369 369 optlist = []
370 370 if not ui.quiet:
371 371 if ui.verbose:
372 372 optlist.append((_("global options:"), commands.globalopts))
373 373 if name == 'shortlist':
374 374 optlist.append((_('use "hg help" for the full list '
375 375 'of commands'), ()))
376 376 else:
377 377 if name == 'shortlist':
378 378 msg = _('use "hg help" for the full list of commands '
379 379 'or "hg -v" for details')
380 380 elif name and not full:
381 381 msg = _('use "hg help %s" to show the full help '
382 382 'text') % name
383 383 else:
384 384 msg = _('use "hg -v help%s" to show builtin aliases and '
385 385 'global options') % (name and " " + name or "")
386 386 optlist.append((msg, ()))
387 387
388 388 if optlist:
389 389 for title, options in optlist:
390 390 rst.append('\n%s\n' % title)
391 391 if options:
392 392 rst.append('\n%s\n' % optrst(options, ui.verbose))
393 393 return rst
394 394
395 395 def helptopic(name):
396 396 for names, header, doc in helptable:
397 397 if name in names:
398 398 break
399 399 else:
400 400 raise error.UnknownCommand(name)
401 401
402 402 rst = [minirst.section(header)]
403 403
404 404 # description
405 405 if not doc:
406 406 rst.append(" %s\n" % _("(no help text available)"))
407 407 if util.safehasattr(doc, '__call__'):
408 408 rst += [" %s\n" % l for l in doc().splitlines()]
409 409
410 410 if not ui.verbose:
411 411 omitted = (_('use "hg help -v %s" to show more complete help') %
412 412 name)
413 413 indicateomitted(rst, omitted)
414 414
415 415 try:
416 416 cmdutil.findcmd(name, commands.table)
417 417 rst.append(_('\nuse "hg help -c %s" to see help for '
418 418 'the %s command\n') % (name, name))
419 419 except error.UnknownCommand:
420 420 pass
421 421 return rst
422 422
423 423 def helpext(name):
424 424 try:
425 425 mod = extensions.find(name)
426 426 doc = gettext(mod.__doc__) or _('no help text available')
427 427 except KeyError:
428 428 mod = None
429 429 doc = extensions.disabledext(name)
430 430 if not doc:
431 431 raise error.UnknownCommand(name)
432 432
433 433 if '\n' not in doc:
434 434 head, tail = doc, ""
435 435 else:
436 436 head, tail = doc.split('\n', 1)
437 437 rst = [_('%s extension - %s\n\n') % (name.split('.')[-1], head)]
438 438 if tail:
439 439 rst.extend(tail.splitlines(True))
440 440 rst.append('\n')
441 441
442 442 if not ui.verbose:
443 443 omitted = (_('use "hg help -v %s" to show more complete help') %
444 444 name)
445 445 indicateomitted(rst, omitted)
446 446
447 447 if mod:
448 448 try:
449 449 ct = mod.cmdtable
450 450 except AttributeError:
451 451 ct = {}
452 452 modcmds = set([c.split('|', 1)[0] for c in ct])
453 453 rst.extend(helplist(modcmds.__contains__))
454 454 else:
455 455 rst.append(_('use "hg help extensions" for information on enabling '
456 456 'extensions\n'))
457 457 return rst
458 458
459 459 def helpextcmd(name):
460 460 cmd, ext, mod = extensions.disabledcmd(ui, name,
461 461 ui.configbool('ui', 'strict'))
462 462 doc = gettext(mod.__doc__).splitlines()[0]
463 463
464 464 rst = listexts(_("'%s' is provided by the following "
465 465 "extension:") % cmd, {ext: doc}, indent=4)
466 466 rst.append('\n')
467 467 rst.append(_('use "hg help extensions" for information on enabling '
468 468 'extensions\n'))
469 469 return rst
470 470
471 471
472 472 rst = []
473 473 kw = opts.get('keyword')
474 474 if kw:
475 475 matches = topicmatch(kw)
476 476 for t, title in (('topics', _('Topics')),
477 477 ('commands', _('Commands')),
478 478 ('extensions', _('Extensions')),
479 479 ('extensioncommands', _('Extension Commands'))):
480 480 if matches[t]:
481 481 rst.append('%s:\n\n' % title)
482 482 rst.extend(minirst.maketable(sorted(matches[t]), 1))
483 483 rst.append('\n')
484 484 elif name and name != 'shortlist':
485 485 i = None
486 486 if unknowncmd:
487 487 queries = (helpextcmd,)
488 488 elif opts.get('extension'):
489 489 queries = (helpext,)
490 490 elif opts.get('command'):
491 491 queries = (helpcmd,)
492 492 else:
493 493 queries = (helptopic, helpcmd, helpext, helpextcmd)
494 494 for f in queries:
495 495 try:
496 496 rst = f(name)
497 497 i = None
498 498 break
499 499 except error.UnknownCommand, inst:
500 500 i = inst
501 501 if i:
502 502 raise i
503 503 else:
504 504 # program name
505 505 if not ui.quiet:
506 506 rst = [_("Mercurial Distributed SCM\n"), '\n']
507 507 rst.extend(helplist())
508 508
509 509 return ''.join(rst)
@@ -1,2003 +1,2032 b''
1 1 Short help:
2 2
3 3 $ hg
4 4 Mercurial Distributed SCM
5 5
6 6 basic commands:
7 7
8 8 add add the specified files on the next commit
9 9 annotate show changeset information by line for each file
10 10 clone make a copy of an existing repository
11 11 commit commit the specified files or all outstanding changes
12 12 diff diff repository (or selected files)
13 13 export dump the header and diffs for one or more changesets
14 14 forget forget the specified files on the next commit
15 15 init create a new repository in the given directory
16 16 log show revision history of entire repository or files
17 17 merge merge 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 $ cat > helpext.py <<EOF
653 654 > import os
654 655 > from mercurial import commands
655 656 >
656 657 > def nohelp(ui, *args, **kwargs):
657 658 > pass
658 659 >
659 660 > cmdtable = {
661 > "debugoptDEP": (nohelp, [('', 'dopt', None, 'option is DEPRECATED')],),
660 662 > "nohelp": (nohelp, [('', 'longdesc', 3, 'x'*90),
661 663 > ('n', '', None, 'normal desc'),
662 664 > ('', 'newline', '', 'line1\nline2'),
663 665 > ], "hg nohelp"),
664 666 > }
665 667 >
666 668 > commands.norepo += ' nohelp'
667 669 > EOF
668 670 $ echo '[extensions]' >> $HGRCPATH
669 671 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
670 672
671 673 Test command with no help text
672 674
673 675 $ hg help nohelp
674 676 hg nohelp
675 677
676 678 (no help text available)
677 679
678 680 options:
679 681
680 682 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
681 683 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
682 684 -n -- normal desc
683 685 --newline VALUE line1 line2
684 686
685 687 use "hg -v help nohelp" to show the global options
686 688
687 689 $ hg help -k nohelp
688 690 Commands:
689 691
690 692 nohelp hg nohelp
691 693
692 694 Extension Commands:
693 695
694 696 nohelp (no help text available)
695 697
696 698 Test that default list of commands omits extension commands
697 699
698 700 $ hg help
699 701 Mercurial Distributed SCM
700 702
701 703 list of commands:
702 704
703 705 add add the specified files on the next commit
704 706 addremove add all new files, delete all missing files
705 707 annotate show changeset information by line for each file
706 708 archive create an unversioned archive of a repository revision
707 709 backout reverse effect of earlier changeset
708 710 bisect subdivision search of changesets
709 711 bookmarks track a line of development with movable markers
710 712 branch set or show the current branch name
711 713 branches list repository named branches
712 714 bundle create a changegroup file
713 715 cat output the current or given revision of files
714 716 clone make a copy of an existing repository
715 717 commit commit the specified files or all outstanding changes
716 718 config show combined config settings from all hgrc files
717 719 copy mark files as copied for the next commit
718 720 diff diff repository (or selected files)
719 721 export dump the header and diffs for one or more changesets
720 722 forget forget the specified files on the next commit
721 723 graft copy changes from other branches onto the current branch
722 724 grep search for a pattern in specified files and revisions
723 725 heads show branch heads
724 726 help show help for a given topic or a help overview
725 727 identify identify the working copy or specified revision
726 728 import import an ordered set of patches
727 729 incoming show new changesets found in source
728 730 init create a new repository in the given directory
729 731 locate locate files matching specific patterns
730 732 log show revision history of entire repository or files
731 733 manifest output the current or given revision of the project manifest
732 734 merge merge working directory with another revision
733 735 outgoing show changesets not found in the destination
734 736 parents show the parents of the working directory or revision
735 737 paths show aliases for remote repositories
736 738 phase set or show the current phase name
737 739 pull pull changes from the specified source
738 740 push push changes to the specified destination
739 741 recover roll back an interrupted transaction
740 742 remove remove the specified files on the next commit
741 743 rename rename files; equivalent of copy + remove
742 744 resolve redo merges or set/view the merge status of files
743 745 revert restore files to their checkout state
744 746 root print the root (top) of the current working directory
745 747 serve start stand-alone webserver
746 748 status show changed files in the working directory
747 749 summary summarize working directory state
748 750 tag add one or more tags for the current or given revision
749 751 tags list repository tags
750 752 unbundle apply one or more changegroup files
751 753 update update working directory (or switch revisions)
752 754 verify verify the integrity of the repository
753 755 version output version and copyright information
754 756
755 757 enabled extensions:
756 758
757 759 helpext (no help text available)
758 760
759 761 additional help topics:
760 762
761 763 config Configuration Files
762 764 dates Date Formats
763 765 diffs Diff Formats
764 766 environment Environment Variables
765 767 extensions Using Additional Features
766 768 filesets Specifying File Sets
767 769 glossary Glossary
768 770 hgignore Syntax for Mercurial Ignore Files
769 771 hgweb Configuring hgweb
770 772 merge-tools Merge Tools
771 773 multirevs Specifying Multiple Revisions
772 774 patterns File Name Patterns
773 775 phases Working with Phases
774 776 revisions Specifying Single Revisions
775 777 revsets Specifying Revision Sets
776 778 subrepos Subrepositories
777 779 templating Template Usage
778 780 urls URL Paths
779 781
780 782 use "hg -v help" to show builtin aliases and global options
781 783
782 784
783 785
784 786 Test list of commands with command with no help text
785 787
786 788 $ hg help helpext
787 789 helpext extension - no help text available
788 790
789 791 list of commands:
790 792
791 793 nohelp (no help text available)
792 794
793 795 use "hg -v help helpext" to show builtin aliases and global options
794 796
797
798 test deprecated option is hidden in command help
799 $ hg help debugoptDEP
800 hg debugoptDEP
801
802 (no help text available)
803
804 options:
805
806 use "hg -v help debugoptDEP" to show the global options
807
808 test deprecated option is shown with -v
809 $ hg help -v debugoptDEP | grep dopt
810 --dopt option is DEPRECATED
811
812 test deprecated option is hidden with translation with untranslated description
813 (use many globy for not failing on changed transaction)
814 $ LANGUAGE=sv hg help debugoptDEP
815 hg debugoptDEP
816
817 (*) (glob)
818
819 flaggor:
820
821 *"hg -v help debugoptDEP"* (glob)
822
823
795 824 Test a help topic
796 825
797 826 $ hg help revs
798 827 Specifying Single Revisions
799 828 """""""""""""""""""""""""""
800 829
801 830 Mercurial supports several ways to specify individual revisions.
802 831
803 832 A plain integer is treated as a revision number. Negative integers are
804 833 treated as sequential offsets from the tip, with -1 denoting the tip, -2
805 834 denoting the revision prior to the tip, and so forth.
806 835
807 836 A 40-digit hexadecimal string is treated as a unique revision identifier.
808 837
809 838 A hexadecimal string less than 40 characters long is treated as a unique
810 839 revision identifier and is referred to as a short-form identifier. A
811 840 short-form identifier is only valid if it is the prefix of exactly one
812 841 full-length identifier.
813 842
814 843 Any other string is treated as a bookmark, tag, or branch name. A bookmark
815 844 is a movable pointer to a revision. A tag is a permanent name associated
816 845 with a revision. A branch name denotes the tipmost open branch head of
817 846 that branch - or if they are all closed, the tipmost closed head of the
818 847 branch. Bookmark, tag, and branch names must not contain the ":"
819 848 character.
820 849
821 850 The reserved name "tip" always identifies the most recent revision.
822 851
823 852 The reserved name "null" indicates the null revision. This is the revision
824 853 of an empty repository, and the parent of revision 0.
825 854
826 855 The reserved name "." indicates the working directory parent. If no
827 856 working directory is checked out, it is equivalent to null. If an
828 857 uncommitted merge is in progress, "." is the revision of the first parent.
829 858
830 859 Test templating help
831 860
832 861 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
833 862 desc String. The text of the changeset description.
834 863 diffstat String. Statistics of changes with the following format:
835 864 firstline Any text. Returns the first line of text.
836 865 nonempty Any text. Returns '(none)' if the string is empty.
837 866
838 867 Test help hooks
839 868
840 869 $ cat > helphook1.py <<EOF
841 870 > from mercurial import help
842 871 >
843 872 > def rewrite(topic, doc):
844 873 > return doc + '\nhelphook1\n'
845 874 >
846 875 > def extsetup(ui):
847 876 > help.addtopichook('revsets', rewrite)
848 877 > EOF
849 878 $ cat > helphook2.py <<EOF
850 879 > from mercurial import help
851 880 >
852 881 > def rewrite(topic, doc):
853 882 > return doc + '\nhelphook2\n'
854 883 >
855 884 > def extsetup(ui):
856 885 > help.addtopichook('revsets', rewrite)
857 886 > EOF
858 887 $ echo '[extensions]' >> $HGRCPATH
859 888 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
860 889 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
861 890 $ hg help revsets | grep helphook
862 891 helphook1
863 892 helphook2
864 893
865 894 Test keyword search help
866 895
867 896 $ cat > prefixedname.py <<EOF
868 897 > '''matched against word "clone"
869 898 > '''
870 899 > EOF
871 900 $ echo '[extensions]' >> $HGRCPATH
872 901 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
873 902 $ hg help -k clone
874 903 Topics:
875 904
876 905 config Configuration Files
877 906 extensions Using Additional Features
878 907 glossary Glossary
879 908 phases Working with Phases
880 909 subrepos Subrepositories
881 910 urls URL Paths
882 911
883 912 Commands:
884 913
885 914 bookmarks track a line of development with movable markers
886 915 clone make a copy of an existing repository
887 916 paths show aliases for remote repositories
888 917 update update working directory (or switch revisions)
889 918
890 919 Extensions:
891 920
892 921 prefixedname matched against word "clone"
893 922 relink recreates hardlinks between repository clones
894 923
895 924 Extension Commands:
896 925
897 926 qclone clone main and patch repository at same time
898 927
899 928 Test omit indicating for help
900 929
901 930 $ cat > addverboseitems.py <<EOF
902 931 > '''extension to test omit indicating.
903 932 >
904 933 > This paragraph is never omitted (for extension)
905 934 >
906 935 > .. container:: verbose
907 936 >
908 937 > This paragraph is omitted,
909 938 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for extension)
910 939 >
911 940 > This paragraph is never omitted, too (for extension)
912 941 > '''
913 942 >
914 943 > from mercurial import help, commands
915 944 > testtopic = """This paragraph is never omitted (for topic).
916 945 >
917 946 > .. container:: verbose
918 947 >
919 948 > This paragraph is omitted,
920 949 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for topic)
921 950 >
922 951 > This paragraph is never omitted, too (for topic)
923 952 > """
924 953 > def extsetup(ui):
925 954 > help.helptable.append((["topic-containing-verbose"],
926 955 > "This is the topic to test omit indicating.",
927 956 > lambda : testtopic))
928 957 > EOF
929 958 $ echo '[extensions]' >> $HGRCPATH
930 959 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
931 960 $ hg help addverboseitems
932 961 addverboseitems extension - extension to test omit indicating.
933 962
934 963 This paragraph is never omitted (for extension)
935 964
936 965 This paragraph is never omitted, too (for extension)
937 966
938 967 use "hg help -v addverboseitems" to show more complete help
939 968
940 969 no commands defined
941 970 $ hg help -v addverboseitems
942 971 addverboseitems extension - extension to test omit indicating.
943 972
944 973 This paragraph is never omitted (for extension)
945 974
946 975 This paragraph is omitted, if "hg help" is invoked witout "-v" (for extension)
947 976
948 977 This paragraph is never omitted, too (for extension)
949 978
950 979 no commands defined
951 980 $ hg help topic-containing-verbose
952 981 This is the topic to test omit indicating.
953 982 """"""""""""""""""""""""""""""""""""""""""
954 983
955 984 This paragraph is never omitted (for topic).
956 985
957 986 This paragraph is never omitted, too (for topic)
958 987
959 988 use "hg help -v topic-containing-verbose" to show more complete help
960 989 $ hg help -v topic-containing-verbose
961 990 This is the topic to test omit indicating.
962 991 """"""""""""""""""""""""""""""""""""""""""
963 992
964 993 This paragraph is never omitted (for topic).
965 994
966 995 This paragraph is omitted, if "hg help" is invoked witout "-v" (for topic)
967 996
968 997 This paragraph is never omitted, too (for topic)
969 998
970 999 Test usage of section marks in help documents
971 1000
972 1001 $ cd "$TESTDIR"/../doc
973 1002 $ python check-seclevel.py
974 1003 $ cd $TESTTMP
975 1004
976 1005 #if serve
977 1006
978 1007 Test the help pages in hgweb.
979 1008
980 1009 Dish up an empty repo; serve it cold.
981 1010
982 1011 $ hg init "$TESTTMP/test"
983 1012 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
984 1013 $ cat hg.pid >> $DAEMON_PIDS
985 1014
986 1015 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help"
987 1016 200 Script output follows
988 1017
989 1018 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
990 1019 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
991 1020 <head>
992 1021 <link rel="icon" href="/static/hgicon.png" type="image/png" />
993 1022 <meta name="robots" content="index, nofollow" />
994 1023 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
995 1024 <script type="text/javascript" src="/static/mercurial.js"></script>
996 1025
997 1026 <title>Help: Index</title>
998 1027 </head>
999 1028 <body>
1000 1029
1001 1030 <div class="container">
1002 1031 <div class="menu">
1003 1032 <div class="logo">
1004 1033 <a href="http://mercurial.selenic.com/">
1005 1034 <img src="/static/hglogo.png" alt="mercurial" /></a>
1006 1035 </div>
1007 1036 <ul>
1008 1037 <li><a href="/shortlog">log</a></li>
1009 1038 <li><a href="/graph">graph</a></li>
1010 1039 <li><a href="/tags">tags</a></li>
1011 1040 <li><a href="/bookmarks">bookmarks</a></li>
1012 1041 <li><a href="/branches">branches</a></li>
1013 1042 </ul>
1014 1043 <ul>
1015 1044 <li class="active">help</li>
1016 1045 </ul>
1017 1046 </div>
1018 1047
1019 1048 <div class="main">
1020 1049 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1021 1050 <form class="search" action="/log">
1022 1051
1023 1052 <p><input name="rev" id="search1" type="text" size="30" /></p>
1024 1053 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1025 1054 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1026 1055 </form>
1027 1056 <table class="bigtable">
1028 1057 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
1029 1058
1030 1059 <tr><td>
1031 1060 <a href="/help/config">
1032 1061 config
1033 1062 </a>
1034 1063 </td><td>
1035 1064 Configuration Files
1036 1065 </td></tr>
1037 1066 <tr><td>
1038 1067 <a href="/help/dates">
1039 1068 dates
1040 1069 </a>
1041 1070 </td><td>
1042 1071 Date Formats
1043 1072 </td></tr>
1044 1073 <tr><td>
1045 1074 <a href="/help/diffs">
1046 1075 diffs
1047 1076 </a>
1048 1077 </td><td>
1049 1078 Diff Formats
1050 1079 </td></tr>
1051 1080 <tr><td>
1052 1081 <a href="/help/environment">
1053 1082 environment
1054 1083 </a>
1055 1084 </td><td>
1056 1085 Environment Variables
1057 1086 </td></tr>
1058 1087 <tr><td>
1059 1088 <a href="/help/extensions">
1060 1089 extensions
1061 1090 </a>
1062 1091 </td><td>
1063 1092 Using Additional Features
1064 1093 </td></tr>
1065 1094 <tr><td>
1066 1095 <a href="/help/filesets">
1067 1096 filesets
1068 1097 </a>
1069 1098 </td><td>
1070 1099 Specifying File Sets
1071 1100 </td></tr>
1072 1101 <tr><td>
1073 1102 <a href="/help/glossary">
1074 1103 glossary
1075 1104 </a>
1076 1105 </td><td>
1077 1106 Glossary
1078 1107 </td></tr>
1079 1108 <tr><td>
1080 1109 <a href="/help/hgignore">
1081 1110 hgignore
1082 1111 </a>
1083 1112 </td><td>
1084 1113 Syntax for Mercurial Ignore Files
1085 1114 </td></tr>
1086 1115 <tr><td>
1087 1116 <a href="/help/hgweb">
1088 1117 hgweb
1089 1118 </a>
1090 1119 </td><td>
1091 1120 Configuring hgweb
1092 1121 </td></tr>
1093 1122 <tr><td>
1094 1123 <a href="/help/merge-tools">
1095 1124 merge-tools
1096 1125 </a>
1097 1126 </td><td>
1098 1127 Merge Tools
1099 1128 </td></tr>
1100 1129 <tr><td>
1101 1130 <a href="/help/multirevs">
1102 1131 multirevs
1103 1132 </a>
1104 1133 </td><td>
1105 1134 Specifying Multiple Revisions
1106 1135 </td></tr>
1107 1136 <tr><td>
1108 1137 <a href="/help/patterns">
1109 1138 patterns
1110 1139 </a>
1111 1140 </td><td>
1112 1141 File Name Patterns
1113 1142 </td></tr>
1114 1143 <tr><td>
1115 1144 <a href="/help/phases">
1116 1145 phases
1117 1146 </a>
1118 1147 </td><td>
1119 1148 Working with Phases
1120 1149 </td></tr>
1121 1150 <tr><td>
1122 1151 <a href="/help/revisions">
1123 1152 revisions
1124 1153 </a>
1125 1154 </td><td>
1126 1155 Specifying Single Revisions
1127 1156 </td></tr>
1128 1157 <tr><td>
1129 1158 <a href="/help/revsets">
1130 1159 revsets
1131 1160 </a>
1132 1161 </td><td>
1133 1162 Specifying Revision Sets
1134 1163 </td></tr>
1135 1164 <tr><td>
1136 1165 <a href="/help/subrepos">
1137 1166 subrepos
1138 1167 </a>
1139 1168 </td><td>
1140 1169 Subrepositories
1141 1170 </td></tr>
1142 1171 <tr><td>
1143 1172 <a href="/help/templating">
1144 1173 templating
1145 1174 </a>
1146 1175 </td><td>
1147 1176 Template Usage
1148 1177 </td></tr>
1149 1178 <tr><td>
1150 1179 <a href="/help/urls">
1151 1180 urls
1152 1181 </a>
1153 1182 </td><td>
1154 1183 URL Paths
1155 1184 </td></tr>
1156 1185 <tr><td>
1157 1186 <a href="/help/topic-containing-verbose">
1158 1187 topic-containing-verbose
1159 1188 </a>
1160 1189 </td><td>
1161 1190 This is the topic to test omit indicating.
1162 1191 </td></tr>
1163 1192
1164 1193 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1165 1194
1166 1195 <tr><td>
1167 1196 <a href="/help/add">
1168 1197 add
1169 1198 </a>
1170 1199 </td><td>
1171 1200 add the specified files on the next commit
1172 1201 </td></tr>
1173 1202 <tr><td>
1174 1203 <a href="/help/annotate">
1175 1204 annotate
1176 1205 </a>
1177 1206 </td><td>
1178 1207 show changeset information by line for each file
1179 1208 </td></tr>
1180 1209 <tr><td>
1181 1210 <a href="/help/clone">
1182 1211 clone
1183 1212 </a>
1184 1213 </td><td>
1185 1214 make a copy of an existing repository
1186 1215 </td></tr>
1187 1216 <tr><td>
1188 1217 <a href="/help/commit">
1189 1218 commit
1190 1219 </a>
1191 1220 </td><td>
1192 1221 commit the specified files or all outstanding changes
1193 1222 </td></tr>
1194 1223 <tr><td>
1195 1224 <a href="/help/diff">
1196 1225 diff
1197 1226 </a>
1198 1227 </td><td>
1199 1228 diff repository (or selected files)
1200 1229 </td></tr>
1201 1230 <tr><td>
1202 1231 <a href="/help/export">
1203 1232 export
1204 1233 </a>
1205 1234 </td><td>
1206 1235 dump the header and diffs for one or more changesets
1207 1236 </td></tr>
1208 1237 <tr><td>
1209 1238 <a href="/help/forget">
1210 1239 forget
1211 1240 </a>
1212 1241 </td><td>
1213 1242 forget the specified files on the next commit
1214 1243 </td></tr>
1215 1244 <tr><td>
1216 1245 <a href="/help/init">
1217 1246 init
1218 1247 </a>
1219 1248 </td><td>
1220 1249 create a new repository in the given directory
1221 1250 </td></tr>
1222 1251 <tr><td>
1223 1252 <a href="/help/log">
1224 1253 log
1225 1254 </a>
1226 1255 </td><td>
1227 1256 show revision history of entire repository or files
1228 1257 </td></tr>
1229 1258 <tr><td>
1230 1259 <a href="/help/merge">
1231 1260 merge
1232 1261 </a>
1233 1262 </td><td>
1234 1263 merge working directory with another revision
1235 1264 </td></tr>
1236 1265 <tr><td>
1237 1266 <a href="/help/pull">
1238 1267 pull
1239 1268 </a>
1240 1269 </td><td>
1241 1270 pull changes from the specified source
1242 1271 </td></tr>
1243 1272 <tr><td>
1244 1273 <a href="/help/push">
1245 1274 push
1246 1275 </a>
1247 1276 </td><td>
1248 1277 push changes to the specified destination
1249 1278 </td></tr>
1250 1279 <tr><td>
1251 1280 <a href="/help/remove">
1252 1281 remove
1253 1282 </a>
1254 1283 </td><td>
1255 1284 remove the specified files on the next commit
1256 1285 </td></tr>
1257 1286 <tr><td>
1258 1287 <a href="/help/serve">
1259 1288 serve
1260 1289 </a>
1261 1290 </td><td>
1262 1291 start stand-alone webserver
1263 1292 </td></tr>
1264 1293 <tr><td>
1265 1294 <a href="/help/status">
1266 1295 status
1267 1296 </a>
1268 1297 </td><td>
1269 1298 show changed files in the working directory
1270 1299 </td></tr>
1271 1300 <tr><td>
1272 1301 <a href="/help/summary">
1273 1302 summary
1274 1303 </a>
1275 1304 </td><td>
1276 1305 summarize working directory state
1277 1306 </td></tr>
1278 1307 <tr><td>
1279 1308 <a href="/help/update">
1280 1309 update
1281 1310 </a>
1282 1311 </td><td>
1283 1312 update working directory (or switch revisions)
1284 1313 </td></tr>
1285 1314
1286 1315 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1287 1316
1288 1317 <tr><td>
1289 1318 <a href="/help/addremove">
1290 1319 addremove
1291 1320 </a>
1292 1321 </td><td>
1293 1322 add all new files, delete all missing files
1294 1323 </td></tr>
1295 1324 <tr><td>
1296 1325 <a href="/help/archive">
1297 1326 archive
1298 1327 </a>
1299 1328 </td><td>
1300 1329 create an unversioned archive of a repository revision
1301 1330 </td></tr>
1302 1331 <tr><td>
1303 1332 <a href="/help/backout">
1304 1333 backout
1305 1334 </a>
1306 1335 </td><td>
1307 1336 reverse effect of earlier changeset
1308 1337 </td></tr>
1309 1338 <tr><td>
1310 1339 <a href="/help/bisect">
1311 1340 bisect
1312 1341 </a>
1313 1342 </td><td>
1314 1343 subdivision search of changesets
1315 1344 </td></tr>
1316 1345 <tr><td>
1317 1346 <a href="/help/bookmarks">
1318 1347 bookmarks
1319 1348 </a>
1320 1349 </td><td>
1321 1350 track a line of development with movable markers
1322 1351 </td></tr>
1323 1352 <tr><td>
1324 1353 <a href="/help/branch">
1325 1354 branch
1326 1355 </a>
1327 1356 </td><td>
1328 1357 set or show the current branch name
1329 1358 </td></tr>
1330 1359 <tr><td>
1331 1360 <a href="/help/branches">
1332 1361 branches
1333 1362 </a>
1334 1363 </td><td>
1335 1364 list repository named branches
1336 1365 </td></tr>
1337 1366 <tr><td>
1338 1367 <a href="/help/bundle">
1339 1368 bundle
1340 1369 </a>
1341 1370 </td><td>
1342 1371 create a changegroup file
1343 1372 </td></tr>
1344 1373 <tr><td>
1345 1374 <a href="/help/cat">
1346 1375 cat
1347 1376 </a>
1348 1377 </td><td>
1349 1378 output the current or given revision of files
1350 1379 </td></tr>
1351 1380 <tr><td>
1352 1381 <a href="/help/config">
1353 1382 config
1354 1383 </a>
1355 1384 </td><td>
1356 1385 show combined config settings from all hgrc files
1357 1386 </td></tr>
1358 1387 <tr><td>
1359 1388 <a href="/help/copy">
1360 1389 copy
1361 1390 </a>
1362 1391 </td><td>
1363 1392 mark files as copied for the next commit
1364 1393 </td></tr>
1365 1394 <tr><td>
1366 1395 <a href="/help/graft">
1367 1396 graft
1368 1397 </a>
1369 1398 </td><td>
1370 1399 copy changes from other branches onto the current branch
1371 1400 </td></tr>
1372 1401 <tr><td>
1373 1402 <a href="/help/grep">
1374 1403 grep
1375 1404 </a>
1376 1405 </td><td>
1377 1406 search for a pattern in specified files and revisions
1378 1407 </td></tr>
1379 1408 <tr><td>
1380 1409 <a href="/help/heads">
1381 1410 heads
1382 1411 </a>
1383 1412 </td><td>
1384 1413 show branch heads
1385 1414 </td></tr>
1386 1415 <tr><td>
1387 1416 <a href="/help/help">
1388 1417 help
1389 1418 </a>
1390 1419 </td><td>
1391 1420 show help for a given topic or a help overview
1392 1421 </td></tr>
1393 1422 <tr><td>
1394 1423 <a href="/help/identify">
1395 1424 identify
1396 1425 </a>
1397 1426 </td><td>
1398 1427 identify the working copy or specified revision
1399 1428 </td></tr>
1400 1429 <tr><td>
1401 1430 <a href="/help/import">
1402 1431 import
1403 1432 </a>
1404 1433 </td><td>
1405 1434 import an ordered set of patches
1406 1435 </td></tr>
1407 1436 <tr><td>
1408 1437 <a href="/help/incoming">
1409 1438 incoming
1410 1439 </a>
1411 1440 </td><td>
1412 1441 show new changesets found in source
1413 1442 </td></tr>
1414 1443 <tr><td>
1415 1444 <a href="/help/locate">
1416 1445 locate
1417 1446 </a>
1418 1447 </td><td>
1419 1448 locate files matching specific patterns
1420 1449 </td></tr>
1421 1450 <tr><td>
1422 1451 <a href="/help/manifest">
1423 1452 manifest
1424 1453 </a>
1425 1454 </td><td>
1426 1455 output the current or given revision of the project manifest
1427 1456 </td></tr>
1428 1457 <tr><td>
1429 1458 <a href="/help/nohelp">
1430 1459 nohelp
1431 1460 </a>
1432 1461 </td><td>
1433 1462 (no help text available)
1434 1463 </td></tr>
1435 1464 <tr><td>
1436 1465 <a href="/help/outgoing">
1437 1466 outgoing
1438 1467 </a>
1439 1468 </td><td>
1440 1469 show changesets not found in the destination
1441 1470 </td></tr>
1442 1471 <tr><td>
1443 1472 <a href="/help/parents">
1444 1473 parents
1445 1474 </a>
1446 1475 </td><td>
1447 1476 show the parents of the working directory or revision
1448 1477 </td></tr>
1449 1478 <tr><td>
1450 1479 <a href="/help/paths">
1451 1480 paths
1452 1481 </a>
1453 1482 </td><td>
1454 1483 show aliases for remote repositories
1455 1484 </td></tr>
1456 1485 <tr><td>
1457 1486 <a href="/help/phase">
1458 1487 phase
1459 1488 </a>
1460 1489 </td><td>
1461 1490 set or show the current phase name
1462 1491 </td></tr>
1463 1492 <tr><td>
1464 1493 <a href="/help/recover">
1465 1494 recover
1466 1495 </a>
1467 1496 </td><td>
1468 1497 roll back an interrupted transaction
1469 1498 </td></tr>
1470 1499 <tr><td>
1471 1500 <a href="/help/rename">
1472 1501 rename
1473 1502 </a>
1474 1503 </td><td>
1475 1504 rename files; equivalent of copy + remove
1476 1505 </td></tr>
1477 1506 <tr><td>
1478 1507 <a href="/help/resolve">
1479 1508 resolve
1480 1509 </a>
1481 1510 </td><td>
1482 1511 redo merges or set/view the merge status of files
1483 1512 </td></tr>
1484 1513 <tr><td>
1485 1514 <a href="/help/revert">
1486 1515 revert
1487 1516 </a>
1488 1517 </td><td>
1489 1518 restore files to their checkout state
1490 1519 </td></tr>
1491 1520 <tr><td>
1492 1521 <a href="/help/root">
1493 1522 root
1494 1523 </a>
1495 1524 </td><td>
1496 1525 print the root (top) of the current working directory
1497 1526 </td></tr>
1498 1527 <tr><td>
1499 1528 <a href="/help/tag">
1500 1529 tag
1501 1530 </a>
1502 1531 </td><td>
1503 1532 add one or more tags for the current or given revision
1504 1533 </td></tr>
1505 1534 <tr><td>
1506 1535 <a href="/help/tags">
1507 1536 tags
1508 1537 </a>
1509 1538 </td><td>
1510 1539 list repository tags
1511 1540 </td></tr>
1512 1541 <tr><td>
1513 1542 <a href="/help/unbundle">
1514 1543 unbundle
1515 1544 </a>
1516 1545 </td><td>
1517 1546 apply one or more changegroup files
1518 1547 </td></tr>
1519 1548 <tr><td>
1520 1549 <a href="/help/verify">
1521 1550 verify
1522 1551 </a>
1523 1552 </td><td>
1524 1553 verify the integrity of the repository
1525 1554 </td></tr>
1526 1555 <tr><td>
1527 1556 <a href="/help/version">
1528 1557 version
1529 1558 </a>
1530 1559 </td><td>
1531 1560 output version and copyright information
1532 1561 </td></tr>
1533 1562 </table>
1534 1563 </div>
1535 1564 </div>
1536 1565
1537 1566 <script type="text/javascript">process_dates()</script>
1538 1567
1539 1568
1540 1569 </body>
1541 1570 </html>
1542 1571
1543 1572
1544 1573 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/add"
1545 1574 200 Script output follows
1546 1575
1547 1576 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1548 1577 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1549 1578 <head>
1550 1579 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1551 1580 <meta name="robots" content="index, nofollow" />
1552 1581 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1553 1582 <script type="text/javascript" src="/static/mercurial.js"></script>
1554 1583
1555 1584 <title>Help: add</title>
1556 1585 </head>
1557 1586 <body>
1558 1587
1559 1588 <div class="container">
1560 1589 <div class="menu">
1561 1590 <div class="logo">
1562 1591 <a href="http://mercurial.selenic.com/">
1563 1592 <img src="/static/hglogo.png" alt="mercurial" /></a>
1564 1593 </div>
1565 1594 <ul>
1566 1595 <li><a href="/shortlog">log</a></li>
1567 1596 <li><a href="/graph">graph</a></li>
1568 1597 <li><a href="/tags">tags</a></li>
1569 1598 <li><a href="/bookmarks">bookmarks</a></li>
1570 1599 <li><a href="/branches">branches</a></li>
1571 1600 </ul>
1572 1601 <ul>
1573 1602 <li class="active"><a href="/help">help</a></li>
1574 1603 </ul>
1575 1604 </div>
1576 1605
1577 1606 <div class="main">
1578 1607 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1579 1608 <h3>Help: add</h3>
1580 1609
1581 1610 <form class="search" action="/log">
1582 1611
1583 1612 <p><input name="rev" id="search1" type="text" size="30" /></p>
1584 1613 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1585 1614 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1586 1615 </form>
1587 1616 <div id="doc">
1588 1617 <p>
1589 1618 hg add [OPTION]... [FILE]...
1590 1619 </p>
1591 1620 <p>
1592 1621 add the specified files on the next commit
1593 1622 </p>
1594 1623 <p>
1595 1624 Schedule files to be version controlled and added to the
1596 1625 repository.
1597 1626 </p>
1598 1627 <p>
1599 1628 The files will be added to the repository at the next commit. To
1600 1629 undo an add before that, see &quot;hg forget&quot;.
1601 1630 </p>
1602 1631 <p>
1603 1632 If no names are given, add all files to the repository.
1604 1633 </p>
1605 1634 <p>
1606 1635 An example showing how new (unknown) files are added
1607 1636 automatically by &quot;hg add&quot;:
1608 1637 </p>
1609 1638 <pre>
1610 1639 \$ ls (re)
1611 1640 foo.c
1612 1641 \$ hg status (re)
1613 1642 ? foo.c
1614 1643 \$ hg add (re)
1615 1644 adding foo.c
1616 1645 \$ hg status (re)
1617 1646 A foo.c
1618 1647 </pre>
1619 1648 <p>
1620 1649 Returns 0 if all files are successfully added.
1621 1650 </p>
1622 1651 <p>
1623 1652 options:
1624 1653 </p>
1625 1654 <table>
1626 1655 <tr><td>-I</td>
1627 1656 <td>--include PATTERN [+]</td>
1628 1657 <td>include names matching the given patterns</td></tr>
1629 1658 <tr><td>-X</td>
1630 1659 <td>--exclude PATTERN [+]</td>
1631 1660 <td>exclude names matching the given patterns</td></tr>
1632 1661 <tr><td>-S</td>
1633 1662 <td>--subrepos</td>
1634 1663 <td>recurse into subrepositories</td></tr>
1635 1664 <tr><td>-n</td>
1636 1665 <td>--dry-run</td>
1637 1666 <td>do not perform actions, just print output</td></tr>
1638 1667 </table>
1639 1668 <p>
1640 1669 [+] marked option can be specified multiple times
1641 1670 </p>
1642 1671 <p>
1643 1672 global options:
1644 1673 </p>
1645 1674 <table>
1646 1675 <tr><td>-R</td>
1647 1676 <td>--repository REPO</td>
1648 1677 <td>repository root directory or name of overlay bundle file</td></tr>
1649 1678 <tr><td></td>
1650 1679 <td>--cwd DIR</td>
1651 1680 <td>change working directory</td></tr>
1652 1681 <tr><td>-y</td>
1653 1682 <td>--noninteractive</td>
1654 1683 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1655 1684 <tr><td>-q</td>
1656 1685 <td>--quiet</td>
1657 1686 <td>suppress output</td></tr>
1658 1687 <tr><td>-v</td>
1659 1688 <td>--verbose</td>
1660 1689 <td>enable additional output</td></tr>
1661 1690 <tr><td></td>
1662 1691 <td>--config CONFIG [+]</td>
1663 1692 <td>set/override config option (use 'section.name=value')</td></tr>
1664 1693 <tr><td></td>
1665 1694 <td>--debug</td>
1666 1695 <td>enable debugging output</td></tr>
1667 1696 <tr><td></td>
1668 1697 <td>--debugger</td>
1669 1698 <td>start debugger</td></tr>
1670 1699 <tr><td></td>
1671 1700 <td>--encoding ENCODE</td>
1672 1701 <td>set the charset encoding (default: ascii)</td></tr>
1673 1702 <tr><td></td>
1674 1703 <td>--encodingmode MODE</td>
1675 1704 <td>set the charset encoding mode (default: strict)</td></tr>
1676 1705 <tr><td></td>
1677 1706 <td>--traceback</td>
1678 1707 <td>always print a traceback on exception</td></tr>
1679 1708 <tr><td></td>
1680 1709 <td>--time</td>
1681 1710 <td>time how long the command takes</td></tr>
1682 1711 <tr><td></td>
1683 1712 <td>--profile</td>
1684 1713 <td>print command execution profile</td></tr>
1685 1714 <tr><td></td>
1686 1715 <td>--version</td>
1687 1716 <td>output version information and exit</td></tr>
1688 1717 <tr><td>-h</td>
1689 1718 <td>--help</td>
1690 1719 <td>display help and exit</td></tr>
1691 1720 <tr><td></td>
1692 1721 <td>--hidden</td>
1693 1722 <td>consider hidden changesets</td></tr>
1694 1723 </table>
1695 1724 <p>
1696 1725 [+] marked option can be specified multiple times
1697 1726 </p>
1698 1727
1699 1728 </div>
1700 1729 </div>
1701 1730 </div>
1702 1731
1703 1732 <script type="text/javascript">process_dates()</script>
1704 1733
1705 1734
1706 1735 </body>
1707 1736 </html>
1708 1737
1709 1738
1710 1739 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/remove"
1711 1740 200 Script output follows
1712 1741
1713 1742 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1714 1743 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1715 1744 <head>
1716 1745 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1717 1746 <meta name="robots" content="index, nofollow" />
1718 1747 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1719 1748 <script type="text/javascript" src="/static/mercurial.js"></script>
1720 1749
1721 1750 <title>Help: remove</title>
1722 1751 </head>
1723 1752 <body>
1724 1753
1725 1754 <div class="container">
1726 1755 <div class="menu">
1727 1756 <div class="logo">
1728 1757 <a href="http://mercurial.selenic.com/">
1729 1758 <img src="/static/hglogo.png" alt="mercurial" /></a>
1730 1759 </div>
1731 1760 <ul>
1732 1761 <li><a href="/shortlog">log</a></li>
1733 1762 <li><a href="/graph">graph</a></li>
1734 1763 <li><a href="/tags">tags</a></li>
1735 1764 <li><a href="/bookmarks">bookmarks</a></li>
1736 1765 <li><a href="/branches">branches</a></li>
1737 1766 </ul>
1738 1767 <ul>
1739 1768 <li class="active"><a href="/help">help</a></li>
1740 1769 </ul>
1741 1770 </div>
1742 1771
1743 1772 <div class="main">
1744 1773 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1745 1774 <h3>Help: remove</h3>
1746 1775
1747 1776 <form class="search" action="/log">
1748 1777
1749 1778 <p><input name="rev" id="search1" type="text" size="30" /></p>
1750 1779 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1751 1780 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1752 1781 </form>
1753 1782 <div id="doc">
1754 1783 <p>
1755 1784 hg remove [OPTION]... FILE...
1756 1785 </p>
1757 1786 <p>
1758 1787 aliases: rm
1759 1788 </p>
1760 1789 <p>
1761 1790 remove the specified files on the next commit
1762 1791 </p>
1763 1792 <p>
1764 1793 Schedule the indicated files for removal from the current branch.
1765 1794 </p>
1766 1795 <p>
1767 1796 This command schedules the files to be removed at the next commit.
1768 1797 To undo a remove before that, see &quot;hg revert&quot;. To undo added
1769 1798 files, see &quot;hg forget&quot;.
1770 1799 </p>
1771 1800 <p>
1772 1801 -A/--after can be used to remove only files that have already
1773 1802 been deleted, -f/--force can be used to force deletion, and -Af
1774 1803 can be used to remove files from the next revision without
1775 1804 deleting them from the working directory.
1776 1805 </p>
1777 1806 <p>
1778 1807 The following table details the behavior of remove for different
1779 1808 file states (columns) and option combinations (rows). The file
1780 1809 states are Added [A], Clean [C], Modified [M] and Missing [!]
1781 1810 (as reported by &quot;hg status&quot;). The actions are Warn, Remove
1782 1811 (from branch) and Delete (from disk):
1783 1812 </p>
1784 1813 <table>
1785 1814 <tr><td>opt/state</td>
1786 1815 <td>A</td>
1787 1816 <td>C</td>
1788 1817 <td>M</td>
1789 1818 <td>!</td></tr>
1790 1819 <tr><td>none</td>
1791 1820 <td>W</td>
1792 1821 <td>RD</td>
1793 1822 <td>W</td>
1794 1823 <td>R</td></tr>
1795 1824 <tr><td>-f</td>
1796 1825 <td>R</td>
1797 1826 <td>RD</td>
1798 1827 <td>RD</td>
1799 1828 <td>R</td></tr>
1800 1829 <tr><td>-A</td>
1801 1830 <td>W</td>
1802 1831 <td>W</td>
1803 1832 <td>W</td>
1804 1833 <td>R</td></tr>
1805 1834 <tr><td>-Af</td>
1806 1835 <td>R</td>
1807 1836 <td>R</td>
1808 1837 <td>R</td>
1809 1838 <td>R</td></tr>
1810 1839 </table>
1811 1840 <p>
1812 1841 Note that remove never deletes files in Added [A] state from the
1813 1842 working directory, not even if option --force is specified.
1814 1843 </p>
1815 1844 <p>
1816 1845 Returns 0 on success, 1 if any warnings encountered.
1817 1846 </p>
1818 1847 <p>
1819 1848 options:
1820 1849 </p>
1821 1850 <table>
1822 1851 <tr><td>-A</td>
1823 1852 <td>--after</td>
1824 1853 <td>record delete for missing files</td></tr>
1825 1854 <tr><td>-f</td>
1826 1855 <td>--force</td>
1827 1856 <td>remove (and delete) file even if added or modified</td></tr>
1828 1857 <tr><td>-I</td>
1829 1858 <td>--include PATTERN [+]</td>
1830 1859 <td>include names matching the given patterns</td></tr>
1831 1860 <tr><td>-X</td>
1832 1861 <td>--exclude PATTERN [+]</td>
1833 1862 <td>exclude names matching the given patterns</td></tr>
1834 1863 </table>
1835 1864 <p>
1836 1865 [+] marked option can be specified multiple times
1837 1866 </p>
1838 1867 <p>
1839 1868 global options:
1840 1869 </p>
1841 1870 <table>
1842 1871 <tr><td>-R</td>
1843 1872 <td>--repository REPO</td>
1844 1873 <td>repository root directory or name of overlay bundle file</td></tr>
1845 1874 <tr><td></td>
1846 1875 <td>--cwd DIR</td>
1847 1876 <td>change working directory</td></tr>
1848 1877 <tr><td>-y</td>
1849 1878 <td>--noninteractive</td>
1850 1879 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1851 1880 <tr><td>-q</td>
1852 1881 <td>--quiet</td>
1853 1882 <td>suppress output</td></tr>
1854 1883 <tr><td>-v</td>
1855 1884 <td>--verbose</td>
1856 1885 <td>enable additional output</td></tr>
1857 1886 <tr><td></td>
1858 1887 <td>--config CONFIG [+]</td>
1859 1888 <td>set/override config option (use 'section.name=value')</td></tr>
1860 1889 <tr><td></td>
1861 1890 <td>--debug</td>
1862 1891 <td>enable debugging output</td></tr>
1863 1892 <tr><td></td>
1864 1893 <td>--debugger</td>
1865 1894 <td>start debugger</td></tr>
1866 1895 <tr><td></td>
1867 1896 <td>--encoding ENCODE</td>
1868 1897 <td>set the charset encoding (default: ascii)</td></tr>
1869 1898 <tr><td></td>
1870 1899 <td>--encodingmode MODE</td>
1871 1900 <td>set the charset encoding mode (default: strict)</td></tr>
1872 1901 <tr><td></td>
1873 1902 <td>--traceback</td>
1874 1903 <td>always print a traceback on exception</td></tr>
1875 1904 <tr><td></td>
1876 1905 <td>--time</td>
1877 1906 <td>time how long the command takes</td></tr>
1878 1907 <tr><td></td>
1879 1908 <td>--profile</td>
1880 1909 <td>print command execution profile</td></tr>
1881 1910 <tr><td></td>
1882 1911 <td>--version</td>
1883 1912 <td>output version information and exit</td></tr>
1884 1913 <tr><td>-h</td>
1885 1914 <td>--help</td>
1886 1915 <td>display help and exit</td></tr>
1887 1916 <tr><td></td>
1888 1917 <td>--hidden</td>
1889 1918 <td>consider hidden changesets</td></tr>
1890 1919 </table>
1891 1920 <p>
1892 1921 [+] marked option can be specified multiple times
1893 1922 </p>
1894 1923
1895 1924 </div>
1896 1925 </div>
1897 1926 </div>
1898 1927
1899 1928 <script type="text/javascript">process_dates()</script>
1900 1929
1901 1930
1902 1931 </body>
1903 1932 </html>
1904 1933
1905 1934
1906 1935 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/revisions"
1907 1936 200 Script output follows
1908 1937
1909 1938 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1910 1939 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1911 1940 <head>
1912 1941 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1913 1942 <meta name="robots" content="index, nofollow" />
1914 1943 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1915 1944 <script type="text/javascript" src="/static/mercurial.js"></script>
1916 1945
1917 1946 <title>Help: revisions</title>
1918 1947 </head>
1919 1948 <body>
1920 1949
1921 1950 <div class="container">
1922 1951 <div class="menu">
1923 1952 <div class="logo">
1924 1953 <a href="http://mercurial.selenic.com/">
1925 1954 <img src="/static/hglogo.png" alt="mercurial" /></a>
1926 1955 </div>
1927 1956 <ul>
1928 1957 <li><a href="/shortlog">log</a></li>
1929 1958 <li><a href="/graph">graph</a></li>
1930 1959 <li><a href="/tags">tags</a></li>
1931 1960 <li><a href="/bookmarks">bookmarks</a></li>
1932 1961 <li><a href="/branches">branches</a></li>
1933 1962 </ul>
1934 1963 <ul>
1935 1964 <li class="active"><a href="/help">help</a></li>
1936 1965 </ul>
1937 1966 </div>
1938 1967
1939 1968 <div class="main">
1940 1969 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1941 1970 <h3>Help: revisions</h3>
1942 1971
1943 1972 <form class="search" action="/log">
1944 1973
1945 1974 <p><input name="rev" id="search1" type="text" size="30" /></p>
1946 1975 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1947 1976 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1948 1977 </form>
1949 1978 <div id="doc">
1950 1979 <h1>Specifying Single Revisions</h1>
1951 1980 <p>
1952 1981 Mercurial supports several ways to specify individual revisions.
1953 1982 </p>
1954 1983 <p>
1955 1984 A plain integer is treated as a revision number. Negative integers are
1956 1985 treated as sequential offsets from the tip, with -1 denoting the tip,
1957 1986 -2 denoting the revision prior to the tip, and so forth.
1958 1987 </p>
1959 1988 <p>
1960 1989 A 40-digit hexadecimal string is treated as a unique revision
1961 1990 identifier.
1962 1991 </p>
1963 1992 <p>
1964 1993 A hexadecimal string less than 40 characters long is treated as a
1965 1994 unique revision identifier and is referred to as a short-form
1966 1995 identifier. A short-form identifier is only valid if it is the prefix
1967 1996 of exactly one full-length identifier.
1968 1997 </p>
1969 1998 <p>
1970 1999 Any other string is treated as a bookmark, tag, or branch name. A
1971 2000 bookmark is a movable pointer to a revision. A tag is a permanent name
1972 2001 associated with a revision. A branch name denotes the tipmost open branch head
1973 2002 of that branch - or if they are all closed, the tipmost closed head of the
1974 2003 branch. Bookmark, tag, and branch names must not contain the &quot;:&quot; character.
1975 2004 </p>
1976 2005 <p>
1977 2006 The reserved name &quot;tip&quot; always identifies the most recent revision.
1978 2007 </p>
1979 2008 <p>
1980 2009 The reserved name &quot;null&quot; indicates the null revision. This is the
1981 2010 revision of an empty repository, and the parent of revision 0.
1982 2011 </p>
1983 2012 <p>
1984 2013 The reserved name &quot;.&quot; indicates the working directory parent. If no
1985 2014 working directory is checked out, it is equivalent to null. If an
1986 2015 uncommitted merge is in progress, &quot;.&quot; is the revision of the first
1987 2016 parent.
1988 2017 </p>
1989 2018
1990 2019 </div>
1991 2020 </div>
1992 2021 </div>
1993 2022
1994 2023 <script type="text/javascript">process_dates()</script>
1995 2024
1996 2025
1997 2026 </body>
1998 2027 </html>
1999 2028
2000 2029
2001 2030 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
2002 2031
2003 2032 #endif
General Comments 0
You need to be logged in to leave comments. Login now