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