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