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