##// END OF EJS Templates
help: hide command line options marked as "advanced"...
Jun Wu -
r31080:6918c921 default
parent child Browse files
Show More
@@ -1,652 +1,655
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 __future__ import absolute_import
9 9
10 10 import itertools
11 11 import os
12 12 import textwrap
13 13
14 14 from .i18n import (
15 15 _,
16 16 gettext,
17 17 )
18 18 from . import (
19 19 cmdutil,
20 20 encoding,
21 21 error,
22 22 extensions,
23 23 filemerge,
24 24 fileset,
25 25 minirst,
26 26 revset,
27 27 templatefilters,
28 28 templatekw,
29 29 templater,
30 30 util,
31 31 )
32 32 from .hgweb import (
33 33 webcommands,
34 34 )
35 35
36 _exclkeywords = [
36 _exclkeywords = set([
37 "(ADVANCED)",
37 38 "(DEPRECATED)",
38 39 "(EXPERIMENTAL)",
40 # i18n: "(ADVANCED)" is a keyword, must be translated consistently
41 _("(ADVANCED)"),
39 42 # i18n: "(DEPRECATED)" is a keyword, must be translated consistently
40 43 _("(DEPRECATED)"),
41 44 # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently
42 45 _("(EXPERIMENTAL)"),
43 ]
46 ])
44 47
45 48 def listexts(header, exts, indent=1, showdeprecated=False):
46 49 '''return a text listing of the given extensions'''
47 50 rst = []
48 51 if exts:
49 52 for name, desc in sorted(exts.iteritems()):
50 53 if not showdeprecated and any(w in desc for w in _exclkeywords):
51 54 continue
52 55 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
53 56 if rst:
54 57 rst.insert(0, '\n%s\n\n' % header)
55 58 return rst
56 59
57 60 def extshelp(ui):
58 61 rst = loaddoc('extensions')(ui).splitlines(True)
59 62 rst.extend(listexts(
60 63 _('enabled extensions:'), extensions.enabled(), showdeprecated=True))
61 64 rst.extend(listexts(_('disabled extensions:'), extensions.disabled()))
62 65 doc = ''.join(rst)
63 66 return doc
64 67
65 68 def optrst(header, options, verbose):
66 69 data = []
67 70 multioccur = False
68 71 for option in options:
69 72 if len(option) == 5:
70 73 shortopt, longopt, default, desc, optlabel = option
71 74 else:
72 75 shortopt, longopt, default, desc = option
73 76 optlabel = _("VALUE") # default label
74 77
75 78 if not verbose and any(w in desc for w in _exclkeywords):
76 79 continue
77 80
78 81 so = ''
79 82 if shortopt:
80 83 so = '-' + shortopt
81 84 lo = '--' + longopt
82 85 if default:
83 86 desc += _(" (default: %s)") % default
84 87
85 88 if isinstance(default, list):
86 89 lo += " %s [+]" % optlabel
87 90 multioccur = True
88 91 elif (default is not None) and not isinstance(default, bool):
89 92 lo += " %s" % optlabel
90 93
91 94 data.append((so, lo, desc))
92 95
93 96 if multioccur:
94 97 header += (_(" ([+] can be repeated)"))
95 98
96 99 rst = ['\n%s:\n\n' % header]
97 100 rst.extend(minirst.maketable(data, 1))
98 101
99 102 return ''.join(rst)
100 103
101 104 def indicateomitted(rst, omitted, notomitted=None):
102 105 rst.append('\n\n.. container:: omitted\n\n %s\n\n' % omitted)
103 106 if notomitted:
104 107 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
105 108
106 109 def filtercmd(ui, cmd, kw, doc):
107 110 if not ui.debugflag and cmd.startswith("debug") and kw != "debug":
108 111 return True
109 112 if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
110 113 return True
111 114 return False
112 115
113 116 def topicmatch(ui, kw):
114 117 """Return help topics matching kw.
115 118
116 119 Returns {'section': [(name, summary), ...], ...} where section is
117 120 one of topics, commands, extensions, or extensioncommands.
118 121 """
119 122 kw = encoding.lower(kw)
120 123 def lowercontains(container):
121 124 return kw in encoding.lower(container) # translated in helptable
122 125 results = {'topics': [],
123 126 'commands': [],
124 127 'extensions': [],
125 128 'extensioncommands': [],
126 129 }
127 130 for names, header, doc in helptable:
128 131 # Old extensions may use a str as doc.
129 132 if (sum(map(lowercontains, names))
130 133 or lowercontains(header)
131 134 or (callable(doc) and lowercontains(doc(ui)))):
132 135 results['topics'].append((names[0], header))
133 136 from . import commands # avoid cycle
134 137 for cmd, entry in commands.table.iteritems():
135 138 if len(entry) == 3:
136 139 summary = entry[2]
137 140 else:
138 141 summary = ''
139 142 # translate docs *before* searching there
140 143 docs = _(getattr(entry[0], '__doc__', None)) or ''
141 144 if kw in cmd or lowercontains(summary) or lowercontains(docs):
142 145 doclines = docs.splitlines()
143 146 if doclines:
144 147 summary = doclines[0]
145 148 cmdname = cmd.partition('|')[0].lstrip('^')
146 149 if filtercmd(ui, cmdname, kw, docs):
147 150 continue
148 151 results['commands'].append((cmdname, summary))
149 152 for name, docs in itertools.chain(
150 153 extensions.enabled(False).iteritems(),
151 154 extensions.disabled().iteritems()):
152 155 if not docs:
153 156 continue
154 157 mod = extensions.load(ui, name, '')
155 158 name = name.rpartition('.')[-1]
156 159 if lowercontains(name) or lowercontains(docs):
157 160 # extension docs are already translated
158 161 results['extensions'].append((name, docs.splitlines()[0]))
159 162 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems():
160 163 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])):
161 164 cmdname = cmd.partition('|')[0].lstrip('^')
162 165 if entry[0].__doc__:
163 166 cmddoc = gettext(entry[0].__doc__).splitlines()[0]
164 167 else:
165 168 cmddoc = _('(no help text available)')
166 169 if filtercmd(ui, cmdname, kw, cmddoc):
167 170 continue
168 171 results['extensioncommands'].append((cmdname, cmddoc))
169 172 return results
170 173
171 174 def loaddoc(topic, subdir=None):
172 175 """Return a delayed loader for help/topic.txt."""
173 176
174 177 def loader(ui):
175 178 docdir = os.path.join(util.datapath, 'help')
176 179 if subdir:
177 180 docdir = os.path.join(docdir, subdir)
178 181 path = os.path.join(docdir, topic + ".txt")
179 182 doc = gettext(util.readfile(path))
180 183 for rewriter in helphooks.get(topic, []):
181 184 doc = rewriter(ui, topic, doc)
182 185 return doc
183 186
184 187 return loader
185 188
186 189 internalstable = sorted([
187 190 (['bundles'], _('Bundles'),
188 191 loaddoc('bundles', subdir='internals')),
189 192 (['changegroups'], _('Changegroups'),
190 193 loaddoc('changegroups', subdir='internals')),
191 194 (['requirements'], _('Repository Requirements'),
192 195 loaddoc('requirements', subdir='internals')),
193 196 (['revlogs'], _('Revision Logs'),
194 197 loaddoc('revlogs', subdir='internals')),
195 198 (['wireprotocol'], _('Wire Protocol'),
196 199 loaddoc('wireprotocol', subdir='internals')),
197 200 ])
198 201
199 202 def internalshelp(ui):
200 203 """Generate the index for the "internals" topic."""
201 204 lines = []
202 205 for names, header, doc in internalstable:
203 206 lines.append(' :%s: %s\n' % (names[0], header))
204 207
205 208 return ''.join(lines)
206 209
207 210 helptable = sorted([
208 211 (["config", "hgrc"], _("Configuration Files"), loaddoc('config')),
209 212 (["dates"], _("Date Formats"), loaddoc('dates')),
210 213 (["patterns"], _("File Name Patterns"), loaddoc('patterns')),
211 214 (['environment', 'env'], _('Environment Variables'),
212 215 loaddoc('environment')),
213 216 (['revisions', 'revs', 'revsets', 'revset', 'multirevs', 'mrevs'],
214 217 _('Specifying Revisions'), loaddoc('revisions')),
215 218 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')),
216 219 (['diffs'], _('Diff Formats'), loaddoc('diffs')),
217 220 (['merge-tools', 'mergetools', 'mergetool'], _('Merge Tools'),
218 221 loaddoc('merge-tools')),
219 222 (['templating', 'templates', 'template', 'style'], _('Template Usage'),
220 223 loaddoc('templates')),
221 224 (['urls'], _('URL Paths'), loaddoc('urls')),
222 225 (["extensions"], _("Using Additional Features"), extshelp),
223 226 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos')),
224 227 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')),
225 228 (["glossary"], _("Glossary"), loaddoc('glossary')),
226 229 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"),
227 230 loaddoc('hgignore')),
228 231 (["phases"], _("Working with Phases"), loaddoc('phases')),
229 232 (['scripting'], _('Using Mercurial from scripts and automation'),
230 233 loaddoc('scripting')),
231 234 (['internals'], _("Technical implementation topics"),
232 235 internalshelp),
233 236 (['pager'], _("Pager Support"), loaddoc('pager')),
234 237 ])
235 238
236 239 # Maps topics with sub-topics to a list of their sub-topics.
237 240 subtopics = {
238 241 'internals': internalstable,
239 242 }
240 243
241 244 # Map topics to lists of callable taking the current topic help and
242 245 # returning the updated version
243 246 helphooks = {}
244 247
245 248 def addtopichook(topic, rewriter):
246 249 helphooks.setdefault(topic, []).append(rewriter)
247 250
248 251 def makeitemsdoc(ui, topic, doc, marker, items, dedent=False):
249 252 """Extract docstring from the items key to function mapping, build a
250 253 single documentation block and use it to overwrite the marker in doc.
251 254 """
252 255 entries = []
253 256 for name in sorted(items):
254 257 text = (items[name].__doc__ or '').rstrip()
255 258 if (not text
256 259 or not ui.verbose and any(w in text for w in _exclkeywords)):
257 260 continue
258 261 text = gettext(text)
259 262 if dedent:
260 263 text = textwrap.dedent(text)
261 264 lines = text.splitlines()
262 265 doclines = [(lines[0])]
263 266 for l in lines[1:]:
264 267 # Stop once we find some Python doctest
265 268 if l.strip().startswith('>>>'):
266 269 break
267 270 if dedent:
268 271 doclines.append(l.rstrip())
269 272 else:
270 273 doclines.append(' ' + l.strip())
271 274 entries.append('\n'.join(doclines))
272 275 entries = '\n\n'.join(entries)
273 276 return doc.replace(marker, entries)
274 277
275 278 def addtopicsymbols(topic, marker, symbols, dedent=False):
276 279 def add(ui, topic, doc):
277 280 return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent)
278 281 addtopichook(topic, add)
279 282
280 283 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
281 284 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
282 285 filemerge.internalsdoc)
283 286 addtopicsymbols('revisions', '.. predicatesmarker', revset.symbols)
284 287 addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords)
285 288 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
286 289 addtopicsymbols('templates', '.. functionsmarker', templater.funcs)
287 290 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
288 291 dedent=True)
289 292
290 293 def help_(ui, name, unknowncmd=False, full=True, subtopic=None, **opts):
291 294 '''
292 295 Generate the help for 'name' as unformatted restructured text. If
293 296 'name' is None, describe the commands available.
294 297 '''
295 298
296 299 from . import commands # avoid cycle
297 300
298 301 def helpcmd(name, subtopic=None):
299 302 try:
300 303 aliases, entry = cmdutil.findcmd(name, commands.table,
301 304 strict=unknowncmd)
302 305 except error.AmbiguousCommand as inst:
303 306 # py3k fix: except vars can't be used outside the scope of the
304 307 # except block, nor can be used inside a lambda. python issue4617
305 308 prefix = inst.args[0]
306 309 select = lambda c: c.lstrip('^').startswith(prefix)
307 310 rst = helplist(select)
308 311 return rst
309 312
310 313 rst = []
311 314
312 315 # check if it's an invalid alias and display its error if it is
313 316 if getattr(entry[0], 'badalias', None):
314 317 rst.append(entry[0].badalias + '\n')
315 318 if entry[0].unknowncmd:
316 319 try:
317 320 rst.extend(helpextcmd(entry[0].cmdname))
318 321 except error.UnknownCommand:
319 322 pass
320 323 return rst
321 324
322 325 # synopsis
323 326 if len(entry) > 2:
324 327 if entry[2].startswith('hg'):
325 328 rst.append("%s\n" % entry[2])
326 329 else:
327 330 rst.append('hg %s %s\n' % (aliases[0], entry[2]))
328 331 else:
329 332 rst.append('hg %s\n' % aliases[0])
330 333 # aliases
331 334 if full and not ui.quiet and len(aliases) > 1:
332 335 rst.append(_("\naliases: %s\n") % ', '.join(aliases[1:]))
333 336 rst.append('\n')
334 337
335 338 # description
336 339 doc = gettext(entry[0].__doc__)
337 340 if not doc:
338 341 doc = _("(no help text available)")
339 342 if util.safehasattr(entry[0], 'definition'): # aliased command
340 343 source = entry[0].source
341 344 if entry[0].definition.startswith('!'): # shell alias
342 345 doc = (_('shell alias for::\n\n %s\n\ndefined by: %s\n') %
343 346 (entry[0].definition[1:], source))
344 347 else:
345 348 doc = (_('alias for: hg %s\n\n%s\n\ndefined by: %s\n') %
346 349 (entry[0].definition, doc, source))
347 350 doc = doc.splitlines(True)
348 351 if ui.quiet or not full:
349 352 rst.append(doc[0])
350 353 else:
351 354 rst.extend(doc)
352 355 rst.append('\n')
353 356
354 357 # check if this command shadows a non-trivial (multi-line)
355 358 # extension help text
356 359 try:
357 360 mod = extensions.find(name)
358 361 doc = gettext(mod.__doc__) or ''
359 362 if '\n' in doc.strip():
360 363 msg = _("(use 'hg help -e %s' to show help for "
361 364 "the %s extension)") % (name, name)
362 365 rst.append('\n%s\n' % msg)
363 366 except KeyError:
364 367 pass
365 368
366 369 # options
367 370 if not ui.quiet and entry[1]:
368 371 rst.append(optrst(_("options"), entry[1], ui.verbose))
369 372
370 373 if ui.verbose:
371 374 rst.append(optrst(_("global options"),
372 375 commands.globalopts, ui.verbose))
373 376
374 377 if not ui.verbose:
375 378 if not full:
376 379 rst.append(_("\n(use 'hg %s -h' to show more help)\n")
377 380 % name)
378 381 elif not ui.quiet:
379 382 rst.append(_('\n(some details hidden, use --verbose '
380 383 'to show complete help)'))
381 384
382 385 return rst
383 386
384 387
385 388 def helplist(select=None, **opts):
386 389 # list of commands
387 390 if name == "shortlist":
388 391 header = _('basic commands:\n\n')
389 392 elif name == "debug":
390 393 header = _('debug commands (internal and unsupported):\n\n')
391 394 else:
392 395 header = _('list of commands:\n\n')
393 396
394 397 h = {}
395 398 cmds = {}
396 399 for c, e in commands.table.iteritems():
397 400 f = c.partition("|")[0]
398 401 if select and not select(f):
399 402 continue
400 403 if (not select and name != 'shortlist' and
401 404 e[0].__module__ != commands.__name__):
402 405 continue
403 406 if name == "shortlist" and not f.startswith("^"):
404 407 continue
405 408 f = f.lstrip("^")
406 409 doc = e[0].__doc__
407 410 if filtercmd(ui, f, name, doc):
408 411 continue
409 412 doc = gettext(doc)
410 413 if not doc:
411 414 doc = _("(no help text available)")
412 415 h[f] = doc.splitlines()[0].rstrip()
413 416 cmds[f] = c.lstrip("^")
414 417
415 418 rst = []
416 419 if not h:
417 420 if not ui.quiet:
418 421 rst.append(_('no commands defined\n'))
419 422 return rst
420 423
421 424 if not ui.quiet:
422 425 rst.append(header)
423 426 fns = sorted(h)
424 427 for f in fns:
425 428 if ui.verbose:
426 429 commacmds = cmds[f].replace("|",", ")
427 430 rst.append(" :%s: %s\n" % (commacmds, h[f]))
428 431 else:
429 432 rst.append(' :%s: %s\n' % (f, h[f]))
430 433
431 434 ex = opts.get
432 435 anyopts = (ex('keyword') or not (ex('command') or ex('extension')))
433 436 if not name and anyopts:
434 437 exts = listexts(_('enabled extensions:'), extensions.enabled())
435 438 if exts:
436 439 rst.append('\n')
437 440 rst.extend(exts)
438 441
439 442 rst.append(_("\nadditional help topics:\n\n"))
440 443 topics = []
441 444 for names, header, doc in helptable:
442 445 topics.append((names[0], header))
443 446 for t, desc in topics:
444 447 rst.append(" :%s: %s\n" % (t, desc))
445 448
446 449 if ui.quiet:
447 450 pass
448 451 elif ui.verbose:
449 452 rst.append('\n%s\n' % optrst(_("global options"),
450 453 commands.globalopts, ui.verbose))
451 454 if name == 'shortlist':
452 455 rst.append(_("\n(use 'hg help' for the full list "
453 456 "of commands)\n"))
454 457 else:
455 458 if name == 'shortlist':
456 459 rst.append(_("\n(use 'hg help' for the full list of commands "
457 460 "or 'hg -v' for details)\n"))
458 461 elif name and not full:
459 462 rst.append(_("\n(use 'hg help %s' to show the full help "
460 463 "text)\n") % name)
461 464 elif name and cmds and name in cmds.keys():
462 465 rst.append(_("\n(use 'hg help -v -e %s' to show built-in "
463 466 "aliases and global options)\n") % name)
464 467 else:
465 468 rst.append(_("\n(use 'hg help -v%s' to show built-in aliases "
466 469 "and global options)\n")
467 470 % (name and " " + name or ""))
468 471 return rst
469 472
470 473 def helptopic(name, subtopic=None):
471 474 # Look for sub-topic entry first.
472 475 header, doc = None, None
473 476 if subtopic and name in subtopics:
474 477 for names, header, doc in subtopics[name]:
475 478 if subtopic in names:
476 479 break
477 480
478 481 if not header:
479 482 for names, header, doc in helptable:
480 483 if name in names:
481 484 break
482 485 else:
483 486 raise error.UnknownCommand(name)
484 487
485 488 rst = [minirst.section(header)]
486 489
487 490 # description
488 491 if not doc:
489 492 rst.append(" %s\n" % _("(no help text available)"))
490 493 if callable(doc):
491 494 rst += [" %s\n" % l for l in doc(ui).splitlines()]
492 495
493 496 if not ui.verbose:
494 497 omitted = _('(some details hidden, use --verbose'
495 498 ' to show complete help)')
496 499 indicateomitted(rst, omitted)
497 500
498 501 try:
499 502 cmdutil.findcmd(name, commands.table)
500 503 rst.append(_("\nuse 'hg help -c %s' to see help for "
501 504 "the %s command\n") % (name, name))
502 505 except error.UnknownCommand:
503 506 pass
504 507 return rst
505 508
506 509 def helpext(name, subtopic=None):
507 510 try:
508 511 mod = extensions.find(name)
509 512 doc = gettext(mod.__doc__) or _('no help text available')
510 513 except KeyError:
511 514 mod = None
512 515 doc = extensions.disabledext(name)
513 516 if not doc:
514 517 raise error.UnknownCommand(name)
515 518
516 519 if '\n' not in doc:
517 520 head, tail = doc, ""
518 521 else:
519 522 head, tail = doc.split('\n', 1)
520 523 rst = [_('%s extension - %s\n\n') % (name.rpartition('.')[-1], head)]
521 524 if tail:
522 525 rst.extend(tail.splitlines(True))
523 526 rst.append('\n')
524 527
525 528 if not ui.verbose:
526 529 omitted = _('(some details hidden, use --verbose'
527 530 ' to show complete help)')
528 531 indicateomitted(rst, omitted)
529 532
530 533 if mod:
531 534 try:
532 535 ct = mod.cmdtable
533 536 except AttributeError:
534 537 ct = {}
535 538 modcmds = set([c.partition('|')[0] for c in ct])
536 539 rst.extend(helplist(modcmds.__contains__))
537 540 else:
538 541 rst.append(_("(use 'hg help extensions' for information on enabling"
539 542 " extensions)\n"))
540 543 return rst
541 544
542 545 def helpextcmd(name, subtopic=None):
543 546 cmd, ext, mod = extensions.disabledcmd(ui, name,
544 547 ui.configbool('ui', 'strict'))
545 548 doc = gettext(mod.__doc__).splitlines()[0]
546 549
547 550 rst = listexts(_("'%s' is provided by the following "
548 551 "extension:") % cmd, {ext: doc}, indent=4,
549 552 showdeprecated=True)
550 553 rst.append('\n')
551 554 rst.append(_("(use 'hg help extensions' for information on enabling "
552 555 "extensions)\n"))
553 556 return rst
554 557
555 558
556 559 rst = []
557 560 kw = opts.get('keyword')
558 561 if kw or name is None and any(opts[o] for o in opts):
559 562 matches = topicmatch(ui, name or '')
560 563 helpareas = []
561 564 if opts.get('extension'):
562 565 helpareas += [('extensions', _('Extensions'))]
563 566 if opts.get('command'):
564 567 helpareas += [('commands', _('Commands'))]
565 568 if not helpareas:
566 569 helpareas = [('topics', _('Topics')),
567 570 ('commands', _('Commands')),
568 571 ('extensions', _('Extensions')),
569 572 ('extensioncommands', _('Extension Commands'))]
570 573 for t, title in helpareas:
571 574 if matches[t]:
572 575 rst.append('%s:\n\n' % title)
573 576 rst.extend(minirst.maketable(sorted(matches[t]), 1))
574 577 rst.append('\n')
575 578 if not rst:
576 579 msg = _('no matches')
577 580 hint = _("try 'hg help' for a list of topics")
578 581 raise error.Abort(msg, hint=hint)
579 582 elif name and name != 'shortlist':
580 583 queries = []
581 584 if unknowncmd:
582 585 queries += [helpextcmd]
583 586 if opts.get('extension'):
584 587 queries += [helpext]
585 588 if opts.get('command'):
586 589 queries += [helpcmd]
587 590 if not queries:
588 591 queries = (helptopic, helpcmd, helpext, helpextcmd)
589 592 for f in queries:
590 593 try:
591 594 rst = f(name, subtopic)
592 595 break
593 596 except error.UnknownCommand:
594 597 pass
595 598 else:
596 599 if unknowncmd:
597 600 raise error.UnknownCommand(name)
598 601 else:
599 602 msg = _('no such help topic: %s') % name
600 603 hint = _("try 'hg help --keyword %s'") % name
601 604 raise error.Abort(msg, hint=hint)
602 605 else:
603 606 # program name
604 607 if not ui.quiet:
605 608 rst = [_("Mercurial Distributed SCM\n"), '\n']
606 609 rst.extend(helplist(None, **opts))
607 610
608 611 return ''.join(rst)
609 612
610 613 def formattedhelp(ui, name, keep=None, unknowncmd=False, full=True, **opts):
611 614 """get help for a given topic (as a dotted name) as rendered rst
612 615
613 616 Either returns the rendered help text or raises an exception.
614 617 """
615 618 if keep is None:
616 619 keep = []
617 620 fullname = name
618 621 section = None
619 622 subtopic = None
620 623 if name and '.' in name:
621 624 name, remaining = name.split('.', 1)
622 625 remaining = encoding.lower(remaining)
623 626 if '.' in remaining:
624 627 subtopic, section = remaining.split('.', 1)
625 628 else:
626 629 if name in subtopics:
627 630 subtopic = remaining
628 631 else:
629 632 section = remaining
630 633 textwidth = ui.configint('ui', 'textwidth', 78)
631 634 termwidth = ui.termwidth() - 2
632 635 if textwidth <= 0 or termwidth < textwidth:
633 636 textwidth = termwidth
634 637 text = help_(ui, name,
635 638 subtopic=subtopic, unknowncmd=unknowncmd, full=full, **opts)
636 639
637 640 formatted, pruned = minirst.format(text, textwidth, keep=keep,
638 641 section=section)
639 642
640 643 # We could have been given a weird ".foo" section without a name
641 644 # to look for, or we could have simply failed to found "foo.bar"
642 645 # because bar isn't a section of foo
643 646 if section and not (formatted and name):
644 647 raise error.Abort(_("help section not found: %s") % fullname)
645 648
646 649 if 'verbose' in pruned:
647 650 keep.append('omitted')
648 651 else:
649 652 keep.append('notomitted')
650 653 formatted, pruned = minirst.format(text, textwidth, keep=keep,
651 654 section=section)
652 655 return formatted
@@ -1,3193 +1,3205
1 1 Short help:
2 2
3 3 $ hg
4 4 Mercurial Distributed SCM
5 5
6 6 basic commands:
7 7
8 8 add add the specified files on the next commit
9 9 annotate show changeset information by line for each file
10 10 clone make a copy of an existing repository
11 11 commit commit the specified files or all outstanding changes
12 12 diff diff repository (or selected files)
13 13 export dump the header and diffs for one or more changesets
14 14 forget forget the specified files on the next commit
15 15 init create a new repository in the given directory
16 16 log show revision history of entire repository or files
17 17 merge merge another revision into working directory
18 18 pull pull changes from the specified source
19 19 push push changes to the specified destination
20 20 remove remove the specified files on the next commit
21 21 serve start stand-alone webserver
22 22 status show changed files in the working directory
23 23 summary summarize working directory state
24 24 update update working directory (or switch revisions)
25 25
26 26 (use 'hg help' for the full list of commands or 'hg -v' for details)
27 27
28 28 $ hg -q
29 29 add add the specified files on the next commit
30 30 annotate show changeset information by line for each file
31 31 clone make a copy of an existing repository
32 32 commit commit the specified files or all outstanding changes
33 33 diff diff repository (or selected files)
34 34 export dump the header and diffs for one or more changesets
35 35 forget forget the specified files on the next commit
36 36 init create a new repository in the given directory
37 37 log show revision history of entire repository or files
38 38 merge merge another revision into working directory
39 39 pull pull changes from the specified source
40 40 push push changes to the specified destination
41 41 remove remove the specified files on the next commit
42 42 serve start stand-alone webserver
43 43 status show changed files in the working directory
44 44 summary summarize working directory state
45 45 update update working directory (or switch revisions)
46 46
47 47 $ hg help
48 48 Mercurial Distributed SCM
49 49
50 50 list of commands:
51 51
52 52 add add the specified files on the next commit
53 53 addremove add all new files, delete all missing files
54 54 annotate show changeset information by line for each file
55 55 archive create an unversioned archive of a repository revision
56 56 backout reverse effect of earlier changeset
57 57 bisect subdivision search of changesets
58 58 bookmarks create a new bookmark or list existing bookmarks
59 59 branch set or show the current branch name
60 60 branches list repository named branches
61 61 bundle create a changegroup file
62 62 cat output the current or given revision of files
63 63 clone make a copy of an existing repository
64 64 commit commit the specified files or all outstanding changes
65 65 config show combined config settings from all hgrc files
66 66 copy mark files as copied for the next commit
67 67 diff diff repository (or selected files)
68 68 export dump the header and diffs for one or more changesets
69 69 files list tracked files
70 70 forget forget the specified files on the next commit
71 71 graft copy changes from other branches onto the current branch
72 72 grep search revision history for a pattern in specified files
73 73 heads show branch heads
74 74 help show help for a given topic or a help overview
75 75 identify identify the working directory or specified revision
76 76 import import an ordered set of patches
77 77 incoming show new changesets found in source
78 78 init create a new repository in the given directory
79 79 log show revision history of entire repository or files
80 80 manifest output the current or given revision of the project manifest
81 81 merge merge another revision into working directory
82 82 outgoing show changesets not found in the destination
83 83 paths show aliases for remote repositories
84 84 phase set or show the current phase name
85 85 pull pull changes from the specified source
86 86 push push changes to the specified destination
87 87 recover roll back an interrupted transaction
88 88 remove remove the specified files on the next commit
89 89 rename rename files; equivalent of copy + remove
90 90 resolve redo merges or set/view the merge status of files
91 91 revert restore files to their checkout state
92 92 root print the root (top) of the current working directory
93 93 serve start stand-alone webserver
94 94 status show changed files in the working directory
95 95 summary summarize working directory state
96 96 tag add one or more tags for the current or given revision
97 97 tags list repository tags
98 98 unbundle apply one or more changegroup files
99 99 update update working directory (or switch revisions)
100 100 verify verify the integrity of the repository
101 101 version output version and copyright information
102 102
103 103 additional help topics:
104 104
105 105 config Configuration Files
106 106 dates Date Formats
107 107 diffs Diff Formats
108 108 environment Environment Variables
109 109 extensions Using Additional Features
110 110 filesets Specifying File Sets
111 111 glossary Glossary
112 112 hgignore Syntax for Mercurial Ignore Files
113 113 hgweb Configuring hgweb
114 114 internals Technical implementation topics
115 115 merge-tools Merge Tools
116 116 pager Pager Support
117 117 patterns File Name Patterns
118 118 phases Working with Phases
119 119 revisions Specifying Revisions
120 120 scripting Using Mercurial from scripts and automation
121 121 subrepos Subrepositories
122 122 templating Template Usage
123 123 urls URL Paths
124 124
125 125 (use 'hg help -v' to show built-in 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 create a new bookmark or list existing bookmarks
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 files list tracked files
146 146 forget forget the specified files on the next commit
147 147 graft copy changes from other branches onto the current branch
148 148 grep search revision history for a pattern in specified files
149 149 heads show branch heads
150 150 help show help for a given topic or a help overview
151 151 identify identify the working directory or specified revision
152 152 import import an ordered set of patches
153 153 incoming show new changesets found in source
154 154 init create a new repository in the given directory
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 another revision into working directory
158 158 outgoing show changesets not found in the destination
159 159 paths show aliases for remote repositories
160 160 phase set or show the current phase name
161 161 pull pull changes from the specified source
162 162 push push changes to the specified destination
163 163 recover roll back an interrupted transaction
164 164 remove remove the specified files on the next commit
165 165 rename rename files; equivalent of copy + remove
166 166 resolve redo merges or set/view the merge status of files
167 167 revert restore files to their checkout state
168 168 root print the root (top) of the current working directory
169 169 serve start stand-alone webserver
170 170 status show changed files in the working directory
171 171 summary summarize working directory state
172 172 tag add one or more tags for the current or given revision
173 173 tags list repository tags
174 174 unbundle apply one or more changegroup files
175 175 update update working directory (or switch revisions)
176 176 verify verify the integrity of the repository
177 177 version output version and copyright information
178 178
179 179 additional help topics:
180 180
181 181 config Configuration Files
182 182 dates Date Formats
183 183 diffs Diff Formats
184 184 environment Environment Variables
185 185 extensions Using Additional Features
186 186 filesets Specifying File Sets
187 187 glossary Glossary
188 188 hgignore Syntax for Mercurial Ignore Files
189 189 hgweb Configuring hgweb
190 190 internals Technical implementation topics
191 191 merge-tools Merge Tools
192 192 pager Pager Support
193 193 patterns File Name Patterns
194 194 phases Working with Phases
195 195 revisions Specifying Revisions
196 196 scripting Using Mercurial from scripts and automation
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 censor erase file content at a given revision
251 251 churn command to display statistics about repository history
252 252 clonebundles advertise pre-generated bundles to seed clones
253 253 color colorize output from some commands
254 254 convert import revisions from foreign VCS repositories into
255 255 Mercurial
256 256 eol automatically manage newlines in repository files
257 257 extdiff command to allow external programs to compare revisions
258 258 factotum http authentication with factotum
259 259 gpg commands to sign and verify changesets
260 260 hgk browse the repository in a graphical way
261 261 highlight syntax highlighting for hgweb (requires Pygments)
262 262 histedit interactive history editing
263 263 keyword expand keywords in tracked files
264 264 largefiles track large binary files
265 265 mq manage a stack of patches
266 266 notify hooks for sending email push notifications
267 267 patchbomb command to send changesets as (a series of) patch emails
268 268 purge command to delete untracked files from the working
269 269 directory
270 270 relink recreates hardlinks between repository clones
271 271 schemes extend schemes with shortcuts to repository swarms
272 272 share share a common history between several working directories
273 273 shelve save and restore changes to the working directory
274 274 strip strip changesets and their descendants from history
275 275 transplant command to transplant changesets from another branch
276 276 win32mbcs allow the use of MBCS paths with problematic encodings
277 277 zeroconf discover and advertise repositories on the local network
278 278
279 279 Verify that extension keywords appear in help templates
280 280
281 281 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
282 282
283 283 Test short command list with verbose option
284 284
285 285 $ hg -v help shortlist
286 286 Mercurial Distributed SCM
287 287
288 288 basic commands:
289 289
290 290 add add the specified files on the next commit
291 291 annotate, blame
292 292 show changeset information by line for each file
293 293 clone make a copy of an existing repository
294 294 commit, ci commit the specified files or all outstanding changes
295 295 diff diff repository (or selected files)
296 296 export dump the header and diffs for one or more changesets
297 297 forget forget the specified files on the next commit
298 298 init create a new repository in the given directory
299 299 log, history show revision history of entire repository or files
300 300 merge merge another revision into working directory
301 301 pull pull changes from the specified source
302 302 push push changes to the specified destination
303 303 remove, rm remove the specified files on the next commit
304 304 serve start stand-alone webserver
305 305 status, st show changed files in the working directory
306 306 summary, sum summarize working directory state
307 307 update, up, checkout, co
308 308 update working directory (or switch revisions)
309 309
310 310 global options ([+] can be repeated):
311 311
312 312 -R --repository REPO repository root directory or name of overlay bundle
313 313 file
314 314 --cwd DIR change working directory
315 315 -y --noninteractive do not prompt, automatically pick the first choice for
316 316 all prompts
317 317 -q --quiet suppress output
318 318 -v --verbose enable additional output
319 319 --config CONFIG [+] set/override config option (use 'section.name=value')
320 320 --debug enable debugging output
321 321 --debugger start debugger
322 322 --encoding ENCODE set the charset encoding (default: ascii)
323 323 --encodingmode MODE set the charset encoding mode (default: strict)
324 324 --traceback always print a traceback on exception
325 325 --time time how long the command takes
326 326 --profile print command execution profile
327 327 --version output version information and exit
328 328 -h --help display help and exit
329 329 --hidden consider hidden changesets
330 330 --pager TYPE when to paginate (boolean, always, auto, or never)
331 331 (default: auto)
332 332
333 333 (use 'hg help' for the full list of commands)
334 334
335 335 $ hg add -h
336 336 hg add [OPTION]... [FILE]...
337 337
338 338 add the specified files on the next commit
339 339
340 340 Schedule files to be version controlled and added to the repository.
341 341
342 342 The files will be added to the repository at the next commit. To undo an
343 343 add before that, see 'hg forget'.
344 344
345 345 If no names are given, add all files to the repository (except files
346 346 matching ".hgignore").
347 347
348 348 Returns 0 if all files are successfully added.
349 349
350 350 options ([+] can be repeated):
351 351
352 352 -I --include PATTERN [+] include names matching the given patterns
353 353 -X --exclude PATTERN [+] exclude names matching the given patterns
354 354 -S --subrepos recurse into subrepositories
355 355 -n --dry-run do not perform actions, just print output
356 356
357 357 (some details hidden, use --verbose to show complete help)
358 358
359 359 Verbose help for add
360 360
361 361 $ hg add -hv
362 362 hg add [OPTION]... [FILE]...
363 363
364 364 add the specified files on the next commit
365 365
366 366 Schedule files to be version controlled and added to the repository.
367 367
368 368 The files will be added to the repository at the next commit. To undo an
369 369 add before that, see 'hg forget'.
370 370
371 371 If no names are given, add all files to the repository (except files
372 372 matching ".hgignore").
373 373
374 374 Examples:
375 375
376 376 - New (unknown) files are added automatically by 'hg add':
377 377
378 378 $ ls
379 379 foo.c
380 380 $ hg status
381 381 ? foo.c
382 382 $ hg add
383 383 adding foo.c
384 384 $ hg status
385 385 A foo.c
386 386
387 387 - Specific files to be added can be specified:
388 388
389 389 $ ls
390 390 bar.c foo.c
391 391 $ hg status
392 392 ? bar.c
393 393 ? foo.c
394 394 $ hg add bar.c
395 395 $ hg status
396 396 A bar.c
397 397 ? foo.c
398 398
399 399 Returns 0 if all files are successfully added.
400 400
401 401 options ([+] can be repeated):
402 402
403 403 -I --include PATTERN [+] include names matching the given patterns
404 404 -X --exclude PATTERN [+] exclude names matching the given patterns
405 405 -S --subrepos recurse into subrepositories
406 406 -n --dry-run do not perform actions, just print output
407 407
408 408 global options ([+] can be repeated):
409 409
410 410 -R --repository REPO repository root directory or name of overlay bundle
411 411 file
412 412 --cwd DIR change working directory
413 413 -y --noninteractive do not prompt, automatically pick the first choice for
414 414 all prompts
415 415 -q --quiet suppress output
416 416 -v --verbose enable additional output
417 417 --config CONFIG [+] set/override config option (use 'section.name=value')
418 418 --debug enable debugging output
419 419 --debugger start debugger
420 420 --encoding ENCODE set the charset encoding (default: ascii)
421 421 --encodingmode MODE set the charset encoding mode (default: strict)
422 422 --traceback always print a traceback on exception
423 423 --time time how long the command takes
424 424 --profile print command execution profile
425 425 --version output version information and exit
426 426 -h --help display help and exit
427 427 --hidden consider hidden changesets
428 428 --pager TYPE when to paginate (boolean, always, auto, or never)
429 429 (default: auto)
430 430
431 431 Test the textwidth config option
432 432
433 433 $ hg root -h --config ui.textwidth=50
434 434 hg root
435 435
436 436 print the root (top) of the current working
437 437 directory
438 438
439 439 Print the root directory of the current
440 440 repository.
441 441
442 442 Returns 0 on success.
443 443
444 444 (some details hidden, use --verbose to show
445 445 complete help)
446 446
447 447 Test help option with version option
448 448
449 449 $ hg add -h --version
450 450 Mercurial Distributed SCM (version *) (glob)
451 451 (see https://mercurial-scm.org for more information)
452 452
453 453 Copyright (C) 2005-* Matt Mackall and others (glob)
454 454 This is free software; see the source for copying conditions. There is NO
455 455 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
456 456
457 457 $ hg add --skjdfks
458 458 hg add: option --skjdfks not recognized
459 459 hg add [OPTION]... [FILE]...
460 460
461 461 add the specified files on the next commit
462 462
463 463 options ([+] can be repeated):
464 464
465 465 -I --include PATTERN [+] include names matching the given patterns
466 466 -X --exclude PATTERN [+] exclude names matching the given patterns
467 467 -S --subrepos recurse into subrepositories
468 468 -n --dry-run do not perform actions, just print output
469 469
470 470 (use 'hg add -h' to show more help)
471 471 [255]
472 472
473 473 Test ambiguous command help
474 474
475 475 $ hg help ad
476 476 list of commands:
477 477
478 478 add add the specified files on the next commit
479 479 addremove add all new files, delete all missing files
480 480
481 481 (use 'hg help -v ad' to show built-in aliases and global options)
482 482
483 483 Test command without options
484 484
485 485 $ hg help verify
486 486 hg verify
487 487
488 488 verify the integrity of the repository
489 489
490 490 Verify the integrity of the current repository.
491 491
492 492 This will perform an extensive check of the repository's integrity,
493 493 validating the hashes and checksums of each entry in the changelog,
494 494 manifest, and tracked files, as well as the integrity of their crosslinks
495 495 and indices.
496 496
497 497 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
498 498 information about recovery from corruption of the repository.
499 499
500 500 Returns 0 on success, 1 if errors are encountered.
501 501
502 502 (some details hidden, use --verbose to show complete help)
503 503
504 504 $ hg help diff
505 505 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
506 506
507 507 diff repository (or selected files)
508 508
509 509 Show differences between revisions for the specified files.
510 510
511 511 Differences between files are shown using the unified diff format.
512 512
513 513 Note:
514 514 'hg diff' may generate unexpected results for merges, as it will
515 515 default to comparing against the working directory's first parent
516 516 changeset if no revisions are specified.
517 517
518 518 When two revision arguments are given, then changes are shown between
519 519 those revisions. If only one revision is specified then that revision is
520 520 compared to the working directory, and, when no revisions are specified,
521 521 the working directory files are compared to its first parent.
522 522
523 523 Alternatively you can specify -c/--change with a revision to see the
524 524 changes in that changeset relative to its first parent.
525 525
526 526 Without the -a/--text option, diff will avoid generating diffs of files it
527 527 detects as binary. With -a, diff will generate a diff anyway, probably
528 528 with undesirable results.
529 529
530 530 Use the -g/--git option to generate diffs in the git extended diff format.
531 531 For more information, read 'hg help diffs'.
532 532
533 533 Returns 0 on success.
534 534
535 535 options ([+] can be repeated):
536 536
537 537 -r --rev REV [+] revision
538 538 -c --change REV change made by revision
539 539 -a --text treat all files as text
540 540 -g --git use git extended diff format
541 541 --nodates omit dates from diff headers
542 542 --noprefix omit a/ and b/ prefixes from filenames
543 543 -p --show-function show which function each change is in
544 544 --reverse produce a diff that undoes the changes
545 545 -w --ignore-all-space ignore white space when comparing lines
546 546 -b --ignore-space-change ignore changes in the amount of white space
547 547 -B --ignore-blank-lines ignore changes whose lines are all blank
548 548 -U --unified NUM number of lines of context to show
549 549 --stat output diffstat-style summary of changes
550 550 --root DIR produce diffs relative to subdirectory
551 551 -I --include PATTERN [+] include names matching the given patterns
552 552 -X --exclude PATTERN [+] exclude names matching the given patterns
553 553 -S --subrepos recurse into subrepositories
554 554
555 555 (some details hidden, use --verbose to show complete help)
556 556
557 557 $ hg help status
558 558 hg status [OPTION]... [FILE]...
559 559
560 560 aliases: st
561 561
562 562 show changed files in the working directory
563 563
564 564 Show status of files in the repository. If names are given, only files
565 565 that match are shown. Files that are clean or ignored or the source of a
566 566 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
567 567 -C/--copies or -A/--all are given. Unless options described with "show
568 568 only ..." are given, the options -mardu are used.
569 569
570 570 Option -q/--quiet hides untracked (unknown and ignored) files unless
571 571 explicitly requested with -u/--unknown or -i/--ignored.
572 572
573 573 Note:
574 574 'hg status' may appear to disagree with diff if permissions have
575 575 changed or a merge has occurred. The standard diff format does not
576 576 report permission changes and diff only reports changes relative to one
577 577 merge parent.
578 578
579 579 If one revision is given, it is used as the base revision. If two
580 580 revisions are given, the differences between them are shown. The --change
581 581 option can also be used as a shortcut to list the changed files of a
582 582 revision from its first parent.
583 583
584 584 The codes used to show the status of files are:
585 585
586 586 M = modified
587 587 A = added
588 588 R = removed
589 589 C = clean
590 590 ! = missing (deleted by non-hg command, but still tracked)
591 591 ? = not tracked
592 592 I = ignored
593 593 = origin of the previous file (with --copies)
594 594
595 595 Returns 0 on success.
596 596
597 597 options ([+] can be repeated):
598 598
599 599 -A --all show status of all files
600 600 -m --modified show only modified files
601 601 -a --added show only added files
602 602 -r --removed show only removed files
603 603 -d --deleted show only deleted (but tracked) files
604 604 -c --clean show only files without changes
605 605 -u --unknown show only unknown (not tracked) files
606 606 -i --ignored show only ignored files
607 607 -n --no-status hide status prefix
608 608 -C --copies show source of copied files
609 609 -0 --print0 end filenames with NUL, for use with xargs
610 610 --rev REV [+] show difference from revision
611 611 --change REV list the changed files of a revision
612 612 -I --include PATTERN [+] include names matching the given patterns
613 613 -X --exclude PATTERN [+] exclude names matching the given patterns
614 614 -S --subrepos recurse into subrepositories
615 615
616 616 (some details hidden, use --verbose to show complete help)
617 617
618 618 $ hg -q help status
619 619 hg status [OPTION]... [FILE]...
620 620
621 621 show changed files in the working directory
622 622
623 623 $ hg help foo
624 624 abort: no such help topic: foo
625 625 (try 'hg help --keyword foo')
626 626 [255]
627 627
628 628 $ hg skjdfks
629 629 hg: unknown command 'skjdfks'
630 630 Mercurial Distributed SCM
631 631
632 632 basic commands:
633 633
634 634 add add the specified files on the next commit
635 635 annotate show changeset information by line for each file
636 636 clone make a copy of an existing repository
637 637 commit commit the specified files or all outstanding changes
638 638 diff diff repository (or selected files)
639 639 export dump the header and diffs for one or more changesets
640 640 forget forget the specified files on the next commit
641 641 init create a new repository in the given directory
642 642 log show revision history of entire repository or files
643 643 merge merge another revision into working directory
644 644 pull pull changes from the specified source
645 645 push push changes to the specified destination
646 646 remove remove the specified files on the next commit
647 647 serve start stand-alone webserver
648 648 status show changed files in the working directory
649 649 summary summarize working directory state
650 650 update update working directory (or switch revisions)
651 651
652 652 (use 'hg help' for the full list of commands or 'hg -v' for details)
653 653 [255]
654 654
655 655
656 656 Make sure that we don't run afoul of the help system thinking that
657 657 this is a section and erroring out weirdly.
658 658
659 659 $ hg .log
660 660 hg: unknown command '.log'
661 661 (did you mean log?)
662 662 [255]
663 663
664 664 $ hg log.
665 665 hg: unknown command 'log.'
666 666 (did you mean log?)
667 667 [255]
668 668 $ hg pu.lh
669 669 hg: unknown command 'pu.lh'
670 670 (did you mean one of pull, push?)
671 671 [255]
672 672
673 673 $ cat > helpext.py <<EOF
674 674 > import os
675 675 > from mercurial import cmdutil, commands
676 676 >
677 677 > cmdtable = {}
678 678 > command = cmdutil.command(cmdtable)
679 679 >
680 680 > @command('nohelp',
681 681 > [('', 'longdesc', 3, 'x'*90),
682 682 > ('n', '', None, 'normal desc'),
683 683 > ('', 'newline', '', 'line1\nline2')],
684 684 > 'hg nohelp',
685 685 > norepo=True)
686 > @command('debugoptADV', [('', 'aopt', None, 'option is (ADVANCED)')])
686 687 > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')])
687 688 > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')])
688 689 > def nohelp(ui, *args, **kwargs):
689 690 > pass
690 691 >
691 692 > def uisetup(ui):
692 693 > ui.setconfig('alias', 'shellalias', '!echo hi', 'helpext')
693 694 > ui.setconfig('alias', 'hgalias', 'summary', 'helpext')
694 695 >
695 696 > EOF
696 697 $ echo '[extensions]' >> $HGRCPATH
697 698 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
698 699
699 700 Test for aliases
700 701
701 702 $ hg help hgalias
702 703 hg hgalias [--remote]
703 704
704 705 alias for: hg summary
705 706
706 707 summarize working directory state
707 708
708 709 This generates a brief summary of the working directory state, including
709 710 parents, branch, commit status, phase and available updates.
710 711
711 712 With the --remote option, this will check the default paths for incoming
712 713 and outgoing changes. This can be time-consuming.
713 714
714 715 Returns 0 on success.
715 716
716 717 defined by: helpext
717 718
718 719 options:
719 720
720 721 --remote check for push and pull
721 722
722 723 (some details hidden, use --verbose to show complete help)
723 724
724 725 $ hg help shellalias
725 726 hg shellalias
726 727
727 728 shell alias for:
728 729
729 730 echo hi
730 731
731 732 defined by: helpext
732 733
733 734 (some details hidden, use --verbose to show complete help)
734 735
735 736 Test command with no help text
736 737
737 738 $ hg help nohelp
738 739 hg nohelp
739 740
740 741 (no help text available)
741 742
742 743 options:
743 744
744 745 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
745 746 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
746 747 -n -- normal desc
747 748 --newline VALUE line1 line2
748 749
749 750 (some details hidden, use --verbose to show complete help)
750 751
751 752 $ hg help -k nohelp
752 753 Commands:
753 754
754 755 nohelp hg nohelp
755 756
756 757 Extension Commands:
757 758
758 759 nohelp (no help text available)
759 760
760 761 Test that default list of commands omits extension commands
761 762
762 763 $ hg help
763 764 Mercurial Distributed SCM
764 765
765 766 list of commands:
766 767
767 768 add add the specified files on the next commit
768 769 addremove add all new files, delete all missing files
769 770 annotate show changeset information by line for each file
770 771 archive create an unversioned archive of a repository revision
771 772 backout reverse effect of earlier changeset
772 773 bisect subdivision search of changesets
773 774 bookmarks create a new bookmark or list existing bookmarks
774 775 branch set or show the current branch name
775 776 branches list repository named branches
776 777 bundle create a changegroup file
777 778 cat output the current or given revision of files
778 779 clone make a copy of an existing repository
779 780 commit commit the specified files or all outstanding changes
780 781 config show combined config settings from all hgrc files
781 782 copy mark files as copied for the next commit
782 783 diff diff repository (or selected files)
783 784 export dump the header and diffs for one or more changesets
784 785 files list tracked files
785 786 forget forget the specified files on the next commit
786 787 graft copy changes from other branches onto the current branch
787 788 grep search revision history for a pattern in specified files
788 789 heads show branch heads
789 790 help show help for a given topic or a help overview
790 791 identify identify the working directory or specified revision
791 792 import import an ordered set of patches
792 793 incoming show new changesets found in source
793 794 init create a new repository in the given directory
794 795 log show revision history of entire repository or files
795 796 manifest output the current or given revision of the project manifest
796 797 merge merge another revision into working directory
797 798 outgoing show changesets not found in the destination
798 799 paths show aliases for remote repositories
799 800 phase set or show the current phase name
800 801 pull pull changes from the specified source
801 802 push push changes to the specified destination
802 803 recover roll back an interrupted transaction
803 804 remove remove the specified files on the next commit
804 805 rename rename files; equivalent of copy + remove
805 806 resolve redo merges or set/view the merge status of files
806 807 revert restore files to their checkout state
807 808 root print the root (top) of the current working directory
808 809 serve start stand-alone webserver
809 810 status show changed files in the working directory
810 811 summary summarize working directory state
811 812 tag add one or more tags for the current or given revision
812 813 tags list repository tags
813 814 unbundle apply one or more changegroup files
814 815 update update working directory (or switch revisions)
815 816 verify verify the integrity of the repository
816 817 version output version and copyright information
817 818
818 819 enabled extensions:
819 820
820 821 helpext (no help text available)
821 822
822 823 additional help topics:
823 824
824 825 config Configuration Files
825 826 dates Date Formats
826 827 diffs Diff Formats
827 828 environment Environment Variables
828 829 extensions Using Additional Features
829 830 filesets Specifying File Sets
830 831 glossary Glossary
831 832 hgignore Syntax for Mercurial Ignore Files
832 833 hgweb Configuring hgweb
833 834 internals Technical implementation topics
834 835 merge-tools Merge Tools
835 836 pager Pager Support
836 837 patterns File Name Patterns
837 838 phases Working with Phases
838 839 revisions Specifying Revisions
839 840 scripting Using Mercurial from scripts and automation
840 841 subrepos Subrepositories
841 842 templating Template Usage
842 843 urls URL Paths
843 844
844 845 (use 'hg help -v' to show built-in aliases and global options)
845 846
846 847
847 848 Test list of internal help commands
848 849
849 850 $ hg help debug
850 851 debug commands (internal and unsupported):
851 852
852 853 debugancestor
853 854 find the ancestor revision of two revisions in a given index
854 855 debugapplystreamclonebundle
855 856 apply a stream clone bundle file
856 857 debugbuilddag
857 858 builds a repo with a given DAG from scratch in the current
858 859 empty repo
859 860 debugbundle lists the contents of a bundle
860 861 debugcheckstate
861 862 validate the correctness of the current dirstate
862 863 debugcommands
863 864 list all available commands and options
864 865 debugcomplete
865 866 returns the completion list associated with the given command
866 867 debugcreatestreamclonebundle
867 868 create a stream clone bundle file
868 869 debugdag format the changelog or an index DAG as a concise textual
869 870 description
870 871 debugdata dump the contents of a data file revision
871 872 debugdate parse and display a date
872 873 debugdeltachain
873 874 dump information about delta chains in a revlog
874 875 debugdirstate
875 876 show the contents of the current dirstate
876 877 debugdiscovery
877 878 runs the changeset discovery protocol in isolation
878 879 debugextensions
879 880 show information about active extensions
880 881 debugfileset parse and apply a fileset specification
881 882 debugfsinfo show information detected about current filesystem
882 883 debuggetbundle
883 884 retrieves a bundle from a repo
884 885 debugignore display the combined ignore pattern and information about
885 886 ignored files
886 887 debugindex dump the contents of an index file
887 888 debugindexdot
888 889 dump an index DAG as a graphviz dot file
889 890 debuginstall test Mercurial installation
890 891 debugknown test whether node ids are known to a repo
891 892 debuglocks show or modify state of locks
892 893 debugmergestate
893 894 print merge state
894 895 debugnamecomplete
895 896 complete "names" - tags, open branch names, bookmark names
896 897 debugobsolete
897 898 create arbitrary obsolete marker
899 debugoptADV (no help text available)
898 900 debugoptDEP (no help text available)
899 901 debugoptEXP (no help text available)
900 902 debugpathcomplete
901 903 complete part or all of a tracked path
902 904 debugpushkey access the pushkey key/value protocol
903 905 debugpvec (no help text available)
904 906 debugrebuilddirstate
905 907 rebuild the dirstate as it would look like for the given
906 908 revision
907 909 debugrebuildfncache
908 910 rebuild the fncache file
909 911 debugrename dump rename information
910 912 debugrevlog show data and statistics about a revlog
911 913 debugrevspec parse and apply a revision specification
912 914 debugsetparents
913 915 manually set the parents of the current working directory
914 916 debugsub (no help text available)
915 917 debugsuccessorssets
916 918 show set of successors for revision
917 919 debugtemplate
918 920 parse and apply a template
919 921 debugupgraderepo
920 922 upgrade a repository to use different features
921 923 debugwalk show how files match on given patterns
922 924 debugwireargs
923 925 (no help text available)
924 926
925 927 (use 'hg help -v debug' to show built-in aliases and global options)
926 928
927 929 internals topic renders index of available sub-topics
928 930
929 931 $ hg help internals
930 932 Technical implementation topics
931 933 """""""""""""""""""""""""""""""
932 934
933 935 bundles Bundles
934 936 changegroups Changegroups
935 937 requirements Repository Requirements
936 938 revlogs Revision Logs
937 939 wireprotocol Wire Protocol
938 940
939 941 sub-topics can be accessed
940 942
941 943 $ hg help internals.changegroups
942 944 Changegroups
943 945 """"""""""""
944 946
945 947 Changegroups are representations of repository revlog data, specifically
946 948 the changelog, manifest, and filelogs.
947 949
948 950 There are 3 versions of changegroups: "1", "2", and "3". From a high-
949 951 level, versions "1" and "2" are almost exactly the same, with the only
950 952 difference being a header on entries in the changeset segment. Version "3"
951 953 adds support for exchanging treemanifests and includes revlog flags in the
952 954 delta header.
953 955
954 956 Changegroups consists of 3 logical segments:
955 957
956 958 +---------------------------------+
957 959 | | | |
958 960 | changeset | manifest | filelogs |
959 961 | | | |
960 962 +---------------------------------+
961 963
962 964 The principle building block of each segment is a *chunk*. A *chunk* is a
963 965 framed piece of data:
964 966
965 967 +---------------------------------------+
966 968 | | |
967 969 | length | data |
968 970 | (32 bits) | <length> bytes |
969 971 | | |
970 972 +---------------------------------------+
971 973
972 974 Each chunk starts with a 32-bit big-endian signed integer indicating the
973 975 length of the raw data that follows.
974 976
975 977 There is a special case chunk that has 0 length ("0x00000000"). We call
976 978 this an *empty chunk*.
977 979
978 980 Delta Groups
979 981 ============
980 982
981 983 A *delta group* expresses the content of a revlog as a series of deltas,
982 984 or patches against previous revisions.
983 985
984 986 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
985 987 to signal the end of the delta group:
986 988
987 989 +------------------------------------------------------------------------+
988 990 | | | | | |
989 991 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
990 992 | (32 bits) | (various) | (32 bits) | (various) | (32 bits) |
991 993 | | | | | |
992 994 +------------------------------------------------------------+-----------+
993 995
994 996 Each *chunk*'s data consists of the following:
995 997
996 998 +-----------------------------------------+
997 999 | | | |
998 1000 | delta header | mdiff header | delta |
999 1001 | (various) | (12 bytes) | (various) |
1000 1002 | | | |
1001 1003 +-----------------------------------------+
1002 1004
1003 1005 The *length* field is the byte length of the remaining 3 logical pieces of
1004 1006 data. The *delta* is a diff from an existing entry in the changelog.
1005 1007
1006 1008 The *delta header* is different between versions "1", "2", and "3" of the
1007 1009 changegroup format.
1008 1010
1009 1011 Version 1:
1010 1012
1011 1013 +------------------------------------------------------+
1012 1014 | | | | |
1013 1015 | node | p1 node | p2 node | link node |
1014 1016 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1015 1017 | | | | |
1016 1018 +------------------------------------------------------+
1017 1019
1018 1020 Version 2:
1019 1021
1020 1022 +------------------------------------------------------------------+
1021 1023 | | | | | |
1022 1024 | node | p1 node | p2 node | base node | link node |
1023 1025 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1024 1026 | | | | | |
1025 1027 +------------------------------------------------------------------+
1026 1028
1027 1029 Version 3:
1028 1030
1029 1031 +------------------------------------------------------------------------------+
1030 1032 | | | | | | |
1031 1033 | node | p1 node | p2 node | base node | link node | flags |
1032 1034 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1033 1035 | | | | | | |
1034 1036 +------------------------------------------------------------------------------+
1035 1037
1036 1038 The *mdiff header* consists of 3 32-bit big-endian signed integers
1037 1039 describing offsets at which to apply the following delta content:
1038 1040
1039 1041 +-------------------------------------+
1040 1042 | | | |
1041 1043 | offset | old length | new length |
1042 1044 | (32 bits) | (32 bits) | (32 bits) |
1043 1045 | | | |
1044 1046 +-------------------------------------+
1045 1047
1046 1048 In version 1, the delta is always applied against the previous node from
1047 1049 the changegroup or the first parent if this is the first entry in the
1048 1050 changegroup.
1049 1051
1050 1052 In version 2, the delta base node is encoded in the entry in the
1051 1053 changegroup. This allows the delta to be expressed against any parent,
1052 1054 which can result in smaller deltas and more efficient encoding of data.
1053 1055
1054 1056 Changeset Segment
1055 1057 =================
1056 1058
1057 1059 The *changeset segment* consists of a single *delta group* holding
1058 1060 changelog data. It is followed by an *empty chunk* to denote the boundary
1059 1061 to the *manifests segment*.
1060 1062
1061 1063 Manifest Segment
1062 1064 ================
1063 1065
1064 1066 The *manifest segment* consists of a single *delta group* holding manifest
1065 1067 data. It is followed by an *empty chunk* to denote the boundary to the
1066 1068 *filelogs segment*.
1067 1069
1068 1070 Filelogs Segment
1069 1071 ================
1070 1072
1071 1073 The *filelogs* segment consists of multiple sub-segments, each
1072 1074 corresponding to an individual file whose data is being described:
1073 1075
1074 1076 +--------------------------------------+
1075 1077 | | | | |
1076 1078 | filelog0 | filelog1 | filelog2 | ... |
1077 1079 | | | | |
1078 1080 +--------------------------------------+
1079 1081
1080 1082 In version "3" of the changegroup format, filelogs may include directory
1081 1083 logs when treemanifests are in use. directory logs are identified by
1082 1084 having a trailing '/' on their filename (see below).
1083 1085
1084 1086 The final filelog sub-segment is followed by an *empty chunk* to denote
1085 1087 the end of the segment and the overall changegroup.
1086 1088
1087 1089 Each filelog sub-segment consists of the following:
1088 1090
1089 1091 +------------------------------------------+
1090 1092 | | | |
1091 1093 | filename size | filename | delta group |
1092 1094 | (32 bits) | (various) | (various) |
1093 1095 | | | |
1094 1096 +------------------------------------------+
1095 1097
1096 1098 That is, a *chunk* consisting of the filename (not terminated or padded)
1097 1099 followed by N chunks constituting the *delta group* for this file.
1098 1100
1099 1101 Test list of commands with command with no help text
1100 1102
1101 1103 $ hg help helpext
1102 1104 helpext extension - no help text available
1103 1105
1104 1106 list of commands:
1105 1107
1106 1108 nohelp (no help text available)
1107 1109
1108 1110 (use 'hg help -v helpext' to show built-in aliases and global options)
1109 1111
1110 1112
1111 test deprecated and experimental options are hidden in command help
1113 test advanced, deprecated and experimental options are hidden in command help
1114 $ hg help debugoptADV
1115 hg debugoptADV
1116
1117 (no help text available)
1118
1119 options:
1120
1121 (some details hidden, use --verbose to show complete help)
1112 1122 $ hg help debugoptDEP
1113 1123 hg debugoptDEP
1114 1124
1115 1125 (no help text available)
1116 1126
1117 1127 options:
1118 1128
1119 1129 (some details hidden, use --verbose to show complete help)
1120 1130
1121 1131 $ hg help debugoptEXP
1122 1132 hg debugoptEXP
1123 1133
1124 1134 (no help text available)
1125 1135
1126 1136 options:
1127 1137
1128 1138 (some details hidden, use --verbose to show complete help)
1129 1139
1130 test deprecated and experimental options is shown with -v
1140 test advanced, deprecated and experimental options are shown with -v
1141 $ hg help -v debugoptADV | grep aopt
1142 --aopt option is (ADVANCED)
1131 1143 $ hg help -v debugoptDEP | grep dopt
1132 1144 --dopt option is (DEPRECATED)
1133 1145 $ hg help -v debugoptEXP | grep eopt
1134 1146 --eopt option is (EXPERIMENTAL)
1135 1147
1136 1148 #if gettext
1137 1149 test deprecated option is hidden with translation with untranslated description
1138 1150 (use many globy for not failing on changed transaction)
1139 1151 $ LANGUAGE=sv hg help debugoptDEP
1140 1152 hg debugoptDEP
1141 1153
1142 1154 (*) (glob)
1143 1155
1144 1156 options:
1145 1157
1146 1158 (some details hidden, use --verbose to show complete help)
1147 1159 #endif
1148 1160
1149 1161 Test commands that collide with topics (issue4240)
1150 1162
1151 1163 $ hg config -hq
1152 1164 hg config [-u] [NAME]...
1153 1165
1154 1166 show combined config settings from all hgrc files
1155 1167 $ hg showconfig -hq
1156 1168 hg config [-u] [NAME]...
1157 1169
1158 1170 show combined config settings from all hgrc files
1159 1171
1160 1172 Test a help topic
1161 1173
1162 1174 $ hg help dates
1163 1175 Date Formats
1164 1176 """"""""""""
1165 1177
1166 1178 Some commands allow the user to specify a date, e.g.:
1167 1179
1168 1180 - backout, commit, import, tag: Specify the commit date.
1169 1181 - log, revert, update: Select revision(s) by date.
1170 1182
1171 1183 Many date formats are valid. Here are some examples:
1172 1184
1173 1185 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1174 1186 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1175 1187 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1176 1188 - "Dec 6" (midnight)
1177 1189 - "13:18" (today assumed)
1178 1190 - "3:39" (3:39AM assumed)
1179 1191 - "3:39pm" (15:39)
1180 1192 - "2006-12-06 13:18:29" (ISO 8601 format)
1181 1193 - "2006-12-6 13:18"
1182 1194 - "2006-12-6"
1183 1195 - "12-6"
1184 1196 - "12/6"
1185 1197 - "12/6/6" (Dec 6 2006)
1186 1198 - "today" (midnight)
1187 1199 - "yesterday" (midnight)
1188 1200 - "now" - right now
1189 1201
1190 1202 Lastly, there is Mercurial's internal format:
1191 1203
1192 1204 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1193 1205
1194 1206 This is the internal representation format for dates. The first number is
1195 1207 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1196 1208 is the offset of the local timezone, in seconds west of UTC (negative if
1197 1209 the timezone is east of UTC).
1198 1210
1199 1211 The log command also accepts date ranges:
1200 1212
1201 1213 - "<DATE" - at or before a given date/time
1202 1214 - ">DATE" - on or after a given date/time
1203 1215 - "DATE to DATE" - a date range, inclusive
1204 1216 - "-DAYS" - within a given number of days of today
1205 1217
1206 1218 Test repeated config section name
1207 1219
1208 1220 $ hg help config.host
1209 1221 "http_proxy.host"
1210 1222 Host name and (optional) port of the proxy server, for example
1211 1223 "myproxy:8000".
1212 1224
1213 1225 "smtp.host"
1214 1226 Host name of mail server, e.g. "mail.example.com".
1215 1227
1216 1228 Unrelated trailing paragraphs shouldn't be included
1217 1229
1218 1230 $ hg help config.extramsg | grep '^$'
1219 1231
1220 1232
1221 1233 Test capitalized section name
1222 1234
1223 1235 $ hg help scripting.HGPLAIN > /dev/null
1224 1236
1225 1237 Help subsection:
1226 1238
1227 1239 $ hg help config.charsets |grep "Email example:" > /dev/null
1228 1240 [1]
1229 1241
1230 1242 Show nested definitions
1231 1243 ("profiling.type"[break]"ls"[break]"stat"[break])
1232 1244
1233 1245 $ hg help config.type | egrep '^$'|wc -l
1234 1246 \s*3 (re)
1235 1247
1236 1248 Separate sections from subsections
1237 1249
1238 1250 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1239 1251 "format"
1240 1252 --------
1241 1253
1242 1254 "usegeneraldelta"
1243 1255
1244 1256 "dotencode"
1245 1257
1246 1258 "usefncache"
1247 1259
1248 1260 "usestore"
1249 1261
1250 1262 "profiling"
1251 1263 -----------
1252 1264
1253 1265 "format"
1254 1266
1255 1267 "progress"
1256 1268 ----------
1257 1269
1258 1270 "format"
1259 1271
1260 1272
1261 1273 Last item in help config.*:
1262 1274
1263 1275 $ hg help config.`hg help config|grep '^ "'| \
1264 1276 > tail -1|sed 's![ "]*!!g'`| \
1265 1277 > grep 'hg help -c config' > /dev/null
1266 1278 [1]
1267 1279
1268 1280 note to use help -c for general hg help config:
1269 1281
1270 1282 $ hg help config |grep 'hg help -c config' > /dev/null
1271 1283
1272 1284 Test templating help
1273 1285
1274 1286 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1275 1287 desc String. The text of the changeset description.
1276 1288 diffstat String. Statistics of changes with the following format:
1277 1289 firstline Any text. Returns the first line of text.
1278 1290 nonempty Any text. Returns '(none)' if the string is empty.
1279 1291
1280 1292 Test deprecated items
1281 1293
1282 1294 $ hg help -v templating | grep currentbookmark
1283 1295 currentbookmark
1284 1296 $ hg help templating | (grep currentbookmark || true)
1285 1297
1286 1298 Test help hooks
1287 1299
1288 1300 $ cat > helphook1.py <<EOF
1289 1301 > from mercurial import help
1290 1302 >
1291 1303 > def rewrite(ui, topic, doc):
1292 1304 > return doc + '\nhelphook1\n'
1293 1305 >
1294 1306 > def extsetup(ui):
1295 1307 > help.addtopichook('revisions', rewrite)
1296 1308 > EOF
1297 1309 $ cat > helphook2.py <<EOF
1298 1310 > from mercurial import help
1299 1311 >
1300 1312 > def rewrite(ui, topic, doc):
1301 1313 > return doc + '\nhelphook2\n'
1302 1314 >
1303 1315 > def extsetup(ui):
1304 1316 > help.addtopichook('revisions', rewrite)
1305 1317 > EOF
1306 1318 $ echo '[extensions]' >> $HGRCPATH
1307 1319 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1308 1320 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1309 1321 $ hg help revsets | grep helphook
1310 1322 helphook1
1311 1323 helphook2
1312 1324
1313 1325 help -c should only show debug --debug
1314 1326
1315 1327 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1316 1328 [1]
1317 1329
1318 1330 help -c should only show deprecated for -v
1319 1331
1320 1332 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1321 1333 [1]
1322 1334
1323 1335 Test -s / --system
1324 1336
1325 1337 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1326 1338 > wc -l | sed -e 's/ //g'
1327 1339 0
1328 1340 $ hg help config.files --system unix | grep 'USER' | \
1329 1341 > wc -l | sed -e 's/ //g'
1330 1342 0
1331 1343
1332 1344 Test -e / -c / -k combinations
1333 1345
1334 1346 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1335 1347 Commands:
1336 1348 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1337 1349 Extensions:
1338 1350 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1339 1351 Topics:
1340 1352 Commands:
1341 1353 Extensions:
1342 1354 Extension Commands:
1343 1355 $ hg help -c schemes
1344 1356 abort: no such help topic: schemes
1345 1357 (try 'hg help --keyword schemes')
1346 1358 [255]
1347 1359 $ hg help -e schemes |head -1
1348 1360 schemes extension - extend schemes with shortcuts to repository swarms
1349 1361 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1350 1362 Commands:
1351 1363 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1352 1364 Extensions:
1353 1365 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1354 1366 Extensions:
1355 1367 Commands:
1356 1368 $ hg help -c commit > /dev/null
1357 1369 $ hg help -e -c commit > /dev/null
1358 1370 $ hg help -e commit > /dev/null
1359 1371 abort: no such help topic: commit
1360 1372 (try 'hg help --keyword commit')
1361 1373 [255]
1362 1374
1363 1375 Test keyword search help
1364 1376
1365 1377 $ cat > prefixedname.py <<EOF
1366 1378 > '''matched against word "clone"
1367 1379 > '''
1368 1380 > EOF
1369 1381 $ echo '[extensions]' >> $HGRCPATH
1370 1382 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1371 1383 $ hg help -k clone
1372 1384 Topics:
1373 1385
1374 1386 config Configuration Files
1375 1387 extensions Using Additional Features
1376 1388 glossary Glossary
1377 1389 phases Working with Phases
1378 1390 subrepos Subrepositories
1379 1391 urls URL Paths
1380 1392
1381 1393 Commands:
1382 1394
1383 1395 bookmarks create a new bookmark or list existing bookmarks
1384 1396 clone make a copy of an existing repository
1385 1397 paths show aliases for remote repositories
1386 1398 update update working directory (or switch revisions)
1387 1399
1388 1400 Extensions:
1389 1401
1390 1402 clonebundles advertise pre-generated bundles to seed clones
1391 1403 prefixedname matched against word "clone"
1392 1404 relink recreates hardlinks between repository clones
1393 1405
1394 1406 Extension Commands:
1395 1407
1396 1408 qclone clone main and patch repository at same time
1397 1409
1398 1410 Test unfound topic
1399 1411
1400 1412 $ hg help nonexistingtopicthatwillneverexisteverever
1401 1413 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1402 1414 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1403 1415 [255]
1404 1416
1405 1417 Test unfound keyword
1406 1418
1407 1419 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1408 1420 abort: no matches
1409 1421 (try 'hg help' for a list of topics)
1410 1422 [255]
1411 1423
1412 1424 Test omit indicating for help
1413 1425
1414 1426 $ cat > addverboseitems.py <<EOF
1415 1427 > '''extension to test omit indicating.
1416 1428 >
1417 1429 > This paragraph is never omitted (for extension)
1418 1430 >
1419 1431 > .. container:: verbose
1420 1432 >
1421 1433 > This paragraph is omitted,
1422 1434 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1423 1435 >
1424 1436 > This paragraph is never omitted, too (for extension)
1425 1437 > '''
1426 1438 >
1427 1439 > from mercurial import help, commands
1428 1440 > testtopic = """This paragraph is never omitted (for topic).
1429 1441 >
1430 1442 > .. container:: verbose
1431 1443 >
1432 1444 > This paragraph is omitted,
1433 1445 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1434 1446 >
1435 1447 > This paragraph is never omitted, too (for topic)
1436 1448 > """
1437 1449 > def extsetup(ui):
1438 1450 > help.helptable.append((["topic-containing-verbose"],
1439 1451 > "This is the topic to test omit indicating.",
1440 1452 > lambda ui: testtopic))
1441 1453 > EOF
1442 1454 $ echo '[extensions]' >> $HGRCPATH
1443 1455 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1444 1456 $ hg help addverboseitems
1445 1457 addverboseitems extension - extension to test omit indicating.
1446 1458
1447 1459 This paragraph is never omitted (for extension)
1448 1460
1449 1461 This paragraph is never omitted, too (for extension)
1450 1462
1451 1463 (some details hidden, use --verbose to show complete help)
1452 1464
1453 1465 no commands defined
1454 1466 $ hg help -v addverboseitems
1455 1467 addverboseitems extension - extension to test omit indicating.
1456 1468
1457 1469 This paragraph is never omitted (for extension)
1458 1470
1459 1471 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1460 1472 extension)
1461 1473
1462 1474 This paragraph is never omitted, too (for extension)
1463 1475
1464 1476 no commands defined
1465 1477 $ hg help topic-containing-verbose
1466 1478 This is the topic to test omit indicating.
1467 1479 """"""""""""""""""""""""""""""""""""""""""
1468 1480
1469 1481 This paragraph is never omitted (for topic).
1470 1482
1471 1483 This paragraph is never omitted, too (for topic)
1472 1484
1473 1485 (some details hidden, use --verbose to show complete help)
1474 1486 $ hg help -v topic-containing-verbose
1475 1487 This is the topic to test omit indicating.
1476 1488 """"""""""""""""""""""""""""""""""""""""""
1477 1489
1478 1490 This paragraph is never omitted (for topic).
1479 1491
1480 1492 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1481 1493 topic)
1482 1494
1483 1495 This paragraph is never omitted, too (for topic)
1484 1496
1485 1497 Test section lookup
1486 1498
1487 1499 $ hg help revset.merge
1488 1500 "merge()"
1489 1501 Changeset is a merge changeset.
1490 1502
1491 1503 $ hg help glossary.dag
1492 1504 DAG
1493 1505 The repository of changesets of a distributed version control system
1494 1506 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1495 1507 of nodes and edges, where nodes correspond to changesets and edges
1496 1508 imply a parent -> child relation. This graph can be visualized by
1497 1509 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1498 1510 limited by the requirement for children to have at most two parents.
1499 1511
1500 1512
1501 1513 $ hg help hgrc.paths
1502 1514 "paths"
1503 1515 -------
1504 1516
1505 1517 Assigns symbolic names and behavior to repositories.
1506 1518
1507 1519 Options are symbolic names defining the URL or directory that is the
1508 1520 location of the repository. Example:
1509 1521
1510 1522 [paths]
1511 1523 my_server = https://example.com/my_repo
1512 1524 local_path = /home/me/repo
1513 1525
1514 1526 These symbolic names can be used from the command line. To pull from
1515 1527 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1516 1528 local_path'.
1517 1529
1518 1530 Options containing colons (":") denote sub-options that can influence
1519 1531 behavior for that specific path. Example:
1520 1532
1521 1533 [paths]
1522 1534 my_server = https://example.com/my_path
1523 1535 my_server:pushurl = ssh://example.com/my_path
1524 1536
1525 1537 The following sub-options can be defined:
1526 1538
1527 1539 "pushurl"
1528 1540 The URL to use for push operations. If not defined, the location
1529 1541 defined by the path's main entry is used.
1530 1542
1531 1543 "pushrev"
1532 1544 A revset defining which revisions to push by default.
1533 1545
1534 1546 When 'hg push' is executed without a "-r" argument, the revset defined
1535 1547 by this sub-option is evaluated to determine what to push.
1536 1548
1537 1549 For example, a value of "." will push the working directory's revision
1538 1550 by default.
1539 1551
1540 1552 Revsets specifying bookmarks will not result in the bookmark being
1541 1553 pushed.
1542 1554
1543 1555 The following special named paths exist:
1544 1556
1545 1557 "default"
1546 1558 The URL or directory to use when no source or remote is specified.
1547 1559
1548 1560 'hg clone' will automatically define this path to the location the
1549 1561 repository was cloned from.
1550 1562
1551 1563 "default-push"
1552 1564 (deprecated) The URL or directory for the default 'hg push' location.
1553 1565 "default:pushurl" should be used instead.
1554 1566
1555 1567 $ hg help glossary.mcguffin
1556 1568 abort: help section not found: glossary.mcguffin
1557 1569 [255]
1558 1570
1559 1571 $ hg help glossary.mc.guffin
1560 1572 abort: help section not found: glossary.mc.guffin
1561 1573 [255]
1562 1574
1563 1575 $ hg help template.files
1564 1576 files List of strings. All files modified, added, or removed by
1565 1577 this changeset.
1566 1578 files(pattern)
1567 1579 All files of the current changeset matching the pattern. See
1568 1580 'hg help patterns'.
1569 1581
1570 1582 Test section lookup by translated message
1571 1583
1572 1584 str.lower() instead of encoding.lower(str) on translated message might
1573 1585 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1574 1586 as the second or later byte of multi-byte character.
1575 1587
1576 1588 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1577 1589 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1578 1590 replacement makes message meaningless.
1579 1591
1580 1592 This tests that section lookup by translated string isn't broken by
1581 1593 such str.lower().
1582 1594
1583 1595 $ python <<EOF
1584 1596 > def escape(s):
1585 1597 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1586 1598 > # translation of "record" in ja_JP.cp932
1587 1599 > upper = "\x8bL\x98^"
1588 1600 > # str.lower()-ed section name should be treated as different one
1589 1601 > lower = "\x8bl\x98^"
1590 1602 > with open('ambiguous.py', 'w') as fp:
1591 1603 > fp.write("""# ambiguous section names in ja_JP.cp932
1592 1604 > u'''summary of extension
1593 1605 >
1594 1606 > %s
1595 1607 > ----
1596 1608 >
1597 1609 > Upper name should show only this message
1598 1610 >
1599 1611 > %s
1600 1612 > ----
1601 1613 >
1602 1614 > Lower name should show only this message
1603 1615 >
1604 1616 > subsequent section
1605 1617 > ------------------
1606 1618 >
1607 1619 > This should be hidden at 'hg help ambiguous' with section name.
1608 1620 > '''
1609 1621 > """ % (escape(upper), escape(lower)))
1610 1622 > EOF
1611 1623
1612 1624 $ cat >> $HGRCPATH <<EOF
1613 1625 > [extensions]
1614 1626 > ambiguous = ./ambiguous.py
1615 1627 > EOF
1616 1628
1617 1629 $ python <<EOF | sh
1618 1630 > upper = "\x8bL\x98^"
1619 1631 > print "hg --encoding cp932 help -e ambiguous.%s" % upper
1620 1632 > EOF
1621 1633 \x8bL\x98^ (esc)
1622 1634 ----
1623 1635
1624 1636 Upper name should show only this message
1625 1637
1626 1638
1627 1639 $ python <<EOF | sh
1628 1640 > lower = "\x8bl\x98^"
1629 1641 > print "hg --encoding cp932 help -e ambiguous.%s" % lower
1630 1642 > EOF
1631 1643 \x8bl\x98^ (esc)
1632 1644 ----
1633 1645
1634 1646 Lower name should show only this message
1635 1647
1636 1648
1637 1649 $ cat >> $HGRCPATH <<EOF
1638 1650 > [extensions]
1639 1651 > ambiguous = !
1640 1652 > EOF
1641 1653
1642 1654 Show help content of disabled extensions
1643 1655
1644 1656 $ cat >> $HGRCPATH <<EOF
1645 1657 > [extensions]
1646 1658 > ambiguous = !./ambiguous.py
1647 1659 > EOF
1648 1660 $ hg help -e ambiguous
1649 1661 ambiguous extension - (no help text available)
1650 1662
1651 1663 (use 'hg help extensions' for information on enabling extensions)
1652 1664
1653 1665 Test dynamic list of merge tools only shows up once
1654 1666 $ hg help merge-tools
1655 1667 Merge Tools
1656 1668 """""""""""
1657 1669
1658 1670 To merge files Mercurial uses merge tools.
1659 1671
1660 1672 A merge tool combines two different versions of a file into a merged file.
1661 1673 Merge tools are given the two files and the greatest common ancestor of
1662 1674 the two file versions, so they can determine the changes made on both
1663 1675 branches.
1664 1676
1665 1677 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1666 1678 backout' and in several extensions.
1667 1679
1668 1680 Usually, the merge tool tries to automatically reconcile the files by
1669 1681 combining all non-overlapping changes that occurred separately in the two
1670 1682 different evolutions of the same initial base file. Furthermore, some
1671 1683 interactive merge programs make it easier to manually resolve conflicting
1672 1684 merges, either in a graphical way, or by inserting some conflict markers.
1673 1685 Mercurial does not include any interactive merge programs but relies on
1674 1686 external tools for that.
1675 1687
1676 1688 Available merge tools
1677 1689 =====================
1678 1690
1679 1691 External merge tools and their properties are configured in the merge-
1680 1692 tools configuration section - see hgrc(5) - but they can often just be
1681 1693 named by their executable.
1682 1694
1683 1695 A merge tool is generally usable if its executable can be found on the
1684 1696 system and if it can handle the merge. The executable is found if it is an
1685 1697 absolute or relative executable path or the name of an application in the
1686 1698 executable search path. The tool is assumed to be able to handle the merge
1687 1699 if it can handle symlinks if the file is a symlink, if it can handle
1688 1700 binary files if the file is binary, and if a GUI is available if the tool
1689 1701 requires a GUI.
1690 1702
1691 1703 There are some internal merge tools which can be used. The internal merge
1692 1704 tools are:
1693 1705
1694 1706 ":dump"
1695 1707 Creates three versions of the files to merge, containing the contents of
1696 1708 local, other and base. These files can then be used to perform a merge
1697 1709 manually. If the file to be merged is named "a.txt", these files will
1698 1710 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1699 1711 they will be placed in the same directory as "a.txt".
1700 1712
1701 1713 ":fail"
1702 1714 Rather than attempting to merge files that were modified on both
1703 1715 branches, it marks them as unresolved. The resolve command must be used
1704 1716 to resolve these conflicts.
1705 1717
1706 1718 ":local"
1707 1719 Uses the local 'p1()' version of files as the merged version.
1708 1720
1709 1721 ":merge"
1710 1722 Uses the internal non-interactive simple merge algorithm for merging
1711 1723 files. It will fail if there are any conflicts and leave markers in the
1712 1724 partially merged file. Markers will have two sections, one for each side
1713 1725 of merge.
1714 1726
1715 1727 ":merge-local"
1716 1728 Like :merge, but resolve all conflicts non-interactively in favor of the
1717 1729 local 'p1()' changes.
1718 1730
1719 1731 ":merge-other"
1720 1732 Like :merge, but resolve all conflicts non-interactively in favor of the
1721 1733 other 'p2()' changes.
1722 1734
1723 1735 ":merge3"
1724 1736 Uses the internal non-interactive simple merge algorithm for merging
1725 1737 files. It will fail if there are any conflicts and leave markers in the
1726 1738 partially merged file. Marker will have three sections, one from each
1727 1739 side of the merge and one for the base content.
1728 1740
1729 1741 ":other"
1730 1742 Uses the other 'p2()' version of files as the merged version.
1731 1743
1732 1744 ":prompt"
1733 1745 Asks the user which of the local 'p1()' or the other 'p2()' version to
1734 1746 keep as the merged version.
1735 1747
1736 1748 ":tagmerge"
1737 1749 Uses the internal tag merge algorithm (experimental).
1738 1750
1739 1751 ":union"
1740 1752 Uses the internal non-interactive simple merge algorithm for merging
1741 1753 files. It will use both left and right sides for conflict regions. No
1742 1754 markers are inserted.
1743 1755
1744 1756 Internal tools are always available and do not require a GUI but will by
1745 1757 default not handle symlinks or binary files.
1746 1758
1747 1759 Choosing a merge tool
1748 1760 =====================
1749 1761
1750 1762 Mercurial uses these rules when deciding which merge tool to use:
1751 1763
1752 1764 1. If a tool has been specified with the --tool option to merge or
1753 1765 resolve, it is used. If it is the name of a tool in the merge-tools
1754 1766 configuration, its configuration is used. Otherwise the specified tool
1755 1767 must be executable by the shell.
1756 1768 2. If the "HGMERGE" environment variable is present, its value is used and
1757 1769 must be executable by the shell.
1758 1770 3. If the filename of the file to be merged matches any of the patterns in
1759 1771 the merge-patterns configuration section, the first usable merge tool
1760 1772 corresponding to a matching pattern is used. Here, binary capabilities
1761 1773 of the merge tool are not considered.
1762 1774 4. If ui.merge is set it will be considered next. If the value is not the
1763 1775 name of a configured tool, the specified value is used and must be
1764 1776 executable by the shell. Otherwise the named tool is used if it is
1765 1777 usable.
1766 1778 5. If any usable merge tools are present in the merge-tools configuration
1767 1779 section, the one with the highest priority is used.
1768 1780 6. If a program named "hgmerge" can be found on the system, it is used -
1769 1781 but it will by default not be used for symlinks and binary files.
1770 1782 7. If the file to be merged is not binary and is not a symlink, then
1771 1783 internal ":merge" is used.
1772 1784 8. The merge of the file fails and must be resolved before commit.
1773 1785
1774 1786 Note:
1775 1787 After selecting a merge program, Mercurial will by default attempt to
1776 1788 merge the files using a simple merge algorithm first. Only if it
1777 1789 doesn't succeed because of conflicting changes Mercurial will actually
1778 1790 execute the merge program. Whether to use the simple merge algorithm
1779 1791 first can be controlled by the premerge setting of the merge tool.
1780 1792 Premerge is enabled by default unless the file is binary or a symlink.
1781 1793
1782 1794 See the merge-tools and ui sections of hgrc(5) for details on the
1783 1795 configuration of merge tools.
1784 1796
1785 1797 Test usage of section marks in help documents
1786 1798
1787 1799 $ cd "$TESTDIR"/../doc
1788 1800 $ python check-seclevel.py
1789 1801 $ cd $TESTTMP
1790 1802
1791 1803 #if serve
1792 1804
1793 1805 Test the help pages in hgweb.
1794 1806
1795 1807 Dish up an empty repo; serve it cold.
1796 1808
1797 1809 $ hg init "$TESTTMP/test"
1798 1810 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1799 1811 $ cat hg.pid >> $DAEMON_PIDS
1800 1812
1801 1813 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1802 1814 200 Script output follows
1803 1815
1804 1816 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1805 1817 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1806 1818 <head>
1807 1819 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1808 1820 <meta name="robots" content="index, nofollow" />
1809 1821 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1810 1822 <script type="text/javascript" src="/static/mercurial.js"></script>
1811 1823
1812 1824 <title>Help: Index</title>
1813 1825 </head>
1814 1826 <body>
1815 1827
1816 1828 <div class="container">
1817 1829 <div class="menu">
1818 1830 <div class="logo">
1819 1831 <a href="https://mercurial-scm.org/">
1820 1832 <img src="/static/hglogo.png" alt="mercurial" /></a>
1821 1833 </div>
1822 1834 <ul>
1823 1835 <li><a href="/shortlog">log</a></li>
1824 1836 <li><a href="/graph">graph</a></li>
1825 1837 <li><a href="/tags">tags</a></li>
1826 1838 <li><a href="/bookmarks">bookmarks</a></li>
1827 1839 <li><a href="/branches">branches</a></li>
1828 1840 </ul>
1829 1841 <ul>
1830 1842 <li class="active">help</li>
1831 1843 </ul>
1832 1844 </div>
1833 1845
1834 1846 <div class="main">
1835 1847 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1836 1848 <form class="search" action="/log">
1837 1849
1838 1850 <p><input name="rev" id="search1" type="text" size="30" /></p>
1839 1851 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1840 1852 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1841 1853 </form>
1842 1854 <table class="bigtable">
1843 1855 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1844 1856
1845 1857 <tr><td>
1846 1858 <a href="/help/config">
1847 1859 config
1848 1860 </a>
1849 1861 </td><td>
1850 1862 Configuration Files
1851 1863 </td></tr>
1852 1864 <tr><td>
1853 1865 <a href="/help/dates">
1854 1866 dates
1855 1867 </a>
1856 1868 </td><td>
1857 1869 Date Formats
1858 1870 </td></tr>
1859 1871 <tr><td>
1860 1872 <a href="/help/diffs">
1861 1873 diffs
1862 1874 </a>
1863 1875 </td><td>
1864 1876 Diff Formats
1865 1877 </td></tr>
1866 1878 <tr><td>
1867 1879 <a href="/help/environment">
1868 1880 environment
1869 1881 </a>
1870 1882 </td><td>
1871 1883 Environment Variables
1872 1884 </td></tr>
1873 1885 <tr><td>
1874 1886 <a href="/help/extensions">
1875 1887 extensions
1876 1888 </a>
1877 1889 </td><td>
1878 1890 Using Additional Features
1879 1891 </td></tr>
1880 1892 <tr><td>
1881 1893 <a href="/help/filesets">
1882 1894 filesets
1883 1895 </a>
1884 1896 </td><td>
1885 1897 Specifying File Sets
1886 1898 </td></tr>
1887 1899 <tr><td>
1888 1900 <a href="/help/glossary">
1889 1901 glossary
1890 1902 </a>
1891 1903 </td><td>
1892 1904 Glossary
1893 1905 </td></tr>
1894 1906 <tr><td>
1895 1907 <a href="/help/hgignore">
1896 1908 hgignore
1897 1909 </a>
1898 1910 </td><td>
1899 1911 Syntax for Mercurial Ignore Files
1900 1912 </td></tr>
1901 1913 <tr><td>
1902 1914 <a href="/help/hgweb">
1903 1915 hgweb
1904 1916 </a>
1905 1917 </td><td>
1906 1918 Configuring hgweb
1907 1919 </td></tr>
1908 1920 <tr><td>
1909 1921 <a href="/help/internals">
1910 1922 internals
1911 1923 </a>
1912 1924 </td><td>
1913 1925 Technical implementation topics
1914 1926 </td></tr>
1915 1927 <tr><td>
1916 1928 <a href="/help/merge-tools">
1917 1929 merge-tools
1918 1930 </a>
1919 1931 </td><td>
1920 1932 Merge Tools
1921 1933 </td></tr>
1922 1934 <tr><td>
1923 1935 <a href="/help/pager">
1924 1936 pager
1925 1937 </a>
1926 1938 </td><td>
1927 1939 Pager Support
1928 1940 </td></tr>
1929 1941 <tr><td>
1930 1942 <a href="/help/patterns">
1931 1943 patterns
1932 1944 </a>
1933 1945 </td><td>
1934 1946 File Name Patterns
1935 1947 </td></tr>
1936 1948 <tr><td>
1937 1949 <a href="/help/phases">
1938 1950 phases
1939 1951 </a>
1940 1952 </td><td>
1941 1953 Working with Phases
1942 1954 </td></tr>
1943 1955 <tr><td>
1944 1956 <a href="/help/revisions">
1945 1957 revisions
1946 1958 </a>
1947 1959 </td><td>
1948 1960 Specifying Revisions
1949 1961 </td></tr>
1950 1962 <tr><td>
1951 1963 <a href="/help/scripting">
1952 1964 scripting
1953 1965 </a>
1954 1966 </td><td>
1955 1967 Using Mercurial from scripts and automation
1956 1968 </td></tr>
1957 1969 <tr><td>
1958 1970 <a href="/help/subrepos">
1959 1971 subrepos
1960 1972 </a>
1961 1973 </td><td>
1962 1974 Subrepositories
1963 1975 </td></tr>
1964 1976 <tr><td>
1965 1977 <a href="/help/templating">
1966 1978 templating
1967 1979 </a>
1968 1980 </td><td>
1969 1981 Template Usage
1970 1982 </td></tr>
1971 1983 <tr><td>
1972 1984 <a href="/help/urls">
1973 1985 urls
1974 1986 </a>
1975 1987 </td><td>
1976 1988 URL Paths
1977 1989 </td></tr>
1978 1990 <tr><td>
1979 1991 <a href="/help/topic-containing-verbose">
1980 1992 topic-containing-verbose
1981 1993 </a>
1982 1994 </td><td>
1983 1995 This is the topic to test omit indicating.
1984 1996 </td></tr>
1985 1997
1986 1998
1987 1999 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1988 2000
1989 2001 <tr><td>
1990 2002 <a href="/help/add">
1991 2003 add
1992 2004 </a>
1993 2005 </td><td>
1994 2006 add the specified files on the next commit
1995 2007 </td></tr>
1996 2008 <tr><td>
1997 2009 <a href="/help/annotate">
1998 2010 annotate
1999 2011 </a>
2000 2012 </td><td>
2001 2013 show changeset information by line for each file
2002 2014 </td></tr>
2003 2015 <tr><td>
2004 2016 <a href="/help/clone">
2005 2017 clone
2006 2018 </a>
2007 2019 </td><td>
2008 2020 make a copy of an existing repository
2009 2021 </td></tr>
2010 2022 <tr><td>
2011 2023 <a href="/help/commit">
2012 2024 commit
2013 2025 </a>
2014 2026 </td><td>
2015 2027 commit the specified files or all outstanding changes
2016 2028 </td></tr>
2017 2029 <tr><td>
2018 2030 <a href="/help/diff">
2019 2031 diff
2020 2032 </a>
2021 2033 </td><td>
2022 2034 diff repository (or selected files)
2023 2035 </td></tr>
2024 2036 <tr><td>
2025 2037 <a href="/help/export">
2026 2038 export
2027 2039 </a>
2028 2040 </td><td>
2029 2041 dump the header and diffs for one or more changesets
2030 2042 </td></tr>
2031 2043 <tr><td>
2032 2044 <a href="/help/forget">
2033 2045 forget
2034 2046 </a>
2035 2047 </td><td>
2036 2048 forget the specified files on the next commit
2037 2049 </td></tr>
2038 2050 <tr><td>
2039 2051 <a href="/help/init">
2040 2052 init
2041 2053 </a>
2042 2054 </td><td>
2043 2055 create a new repository in the given directory
2044 2056 </td></tr>
2045 2057 <tr><td>
2046 2058 <a href="/help/log">
2047 2059 log
2048 2060 </a>
2049 2061 </td><td>
2050 2062 show revision history of entire repository or files
2051 2063 </td></tr>
2052 2064 <tr><td>
2053 2065 <a href="/help/merge">
2054 2066 merge
2055 2067 </a>
2056 2068 </td><td>
2057 2069 merge another revision into working directory
2058 2070 </td></tr>
2059 2071 <tr><td>
2060 2072 <a href="/help/pull">
2061 2073 pull
2062 2074 </a>
2063 2075 </td><td>
2064 2076 pull changes from the specified source
2065 2077 </td></tr>
2066 2078 <tr><td>
2067 2079 <a href="/help/push">
2068 2080 push
2069 2081 </a>
2070 2082 </td><td>
2071 2083 push changes to the specified destination
2072 2084 </td></tr>
2073 2085 <tr><td>
2074 2086 <a href="/help/remove">
2075 2087 remove
2076 2088 </a>
2077 2089 </td><td>
2078 2090 remove the specified files on the next commit
2079 2091 </td></tr>
2080 2092 <tr><td>
2081 2093 <a href="/help/serve">
2082 2094 serve
2083 2095 </a>
2084 2096 </td><td>
2085 2097 start stand-alone webserver
2086 2098 </td></tr>
2087 2099 <tr><td>
2088 2100 <a href="/help/status">
2089 2101 status
2090 2102 </a>
2091 2103 </td><td>
2092 2104 show changed files in the working directory
2093 2105 </td></tr>
2094 2106 <tr><td>
2095 2107 <a href="/help/summary">
2096 2108 summary
2097 2109 </a>
2098 2110 </td><td>
2099 2111 summarize working directory state
2100 2112 </td></tr>
2101 2113 <tr><td>
2102 2114 <a href="/help/update">
2103 2115 update
2104 2116 </a>
2105 2117 </td><td>
2106 2118 update working directory (or switch revisions)
2107 2119 </td></tr>
2108 2120
2109 2121
2110 2122
2111 2123 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2112 2124
2113 2125 <tr><td>
2114 2126 <a href="/help/addremove">
2115 2127 addremove
2116 2128 </a>
2117 2129 </td><td>
2118 2130 add all new files, delete all missing files
2119 2131 </td></tr>
2120 2132 <tr><td>
2121 2133 <a href="/help/archive">
2122 2134 archive
2123 2135 </a>
2124 2136 </td><td>
2125 2137 create an unversioned archive of a repository revision
2126 2138 </td></tr>
2127 2139 <tr><td>
2128 2140 <a href="/help/backout">
2129 2141 backout
2130 2142 </a>
2131 2143 </td><td>
2132 2144 reverse effect of earlier changeset
2133 2145 </td></tr>
2134 2146 <tr><td>
2135 2147 <a href="/help/bisect">
2136 2148 bisect
2137 2149 </a>
2138 2150 </td><td>
2139 2151 subdivision search of changesets
2140 2152 </td></tr>
2141 2153 <tr><td>
2142 2154 <a href="/help/bookmarks">
2143 2155 bookmarks
2144 2156 </a>
2145 2157 </td><td>
2146 2158 create a new bookmark or list existing bookmarks
2147 2159 </td></tr>
2148 2160 <tr><td>
2149 2161 <a href="/help/branch">
2150 2162 branch
2151 2163 </a>
2152 2164 </td><td>
2153 2165 set or show the current branch name
2154 2166 </td></tr>
2155 2167 <tr><td>
2156 2168 <a href="/help/branches">
2157 2169 branches
2158 2170 </a>
2159 2171 </td><td>
2160 2172 list repository named branches
2161 2173 </td></tr>
2162 2174 <tr><td>
2163 2175 <a href="/help/bundle">
2164 2176 bundle
2165 2177 </a>
2166 2178 </td><td>
2167 2179 create a changegroup file
2168 2180 </td></tr>
2169 2181 <tr><td>
2170 2182 <a href="/help/cat">
2171 2183 cat
2172 2184 </a>
2173 2185 </td><td>
2174 2186 output the current or given revision of files
2175 2187 </td></tr>
2176 2188 <tr><td>
2177 2189 <a href="/help/config">
2178 2190 config
2179 2191 </a>
2180 2192 </td><td>
2181 2193 show combined config settings from all hgrc files
2182 2194 </td></tr>
2183 2195 <tr><td>
2184 2196 <a href="/help/copy">
2185 2197 copy
2186 2198 </a>
2187 2199 </td><td>
2188 2200 mark files as copied for the next commit
2189 2201 </td></tr>
2190 2202 <tr><td>
2191 2203 <a href="/help/files">
2192 2204 files
2193 2205 </a>
2194 2206 </td><td>
2195 2207 list tracked files
2196 2208 </td></tr>
2197 2209 <tr><td>
2198 2210 <a href="/help/graft">
2199 2211 graft
2200 2212 </a>
2201 2213 </td><td>
2202 2214 copy changes from other branches onto the current branch
2203 2215 </td></tr>
2204 2216 <tr><td>
2205 2217 <a href="/help/grep">
2206 2218 grep
2207 2219 </a>
2208 2220 </td><td>
2209 2221 search revision history for a pattern in specified files
2210 2222 </td></tr>
2211 2223 <tr><td>
2212 2224 <a href="/help/heads">
2213 2225 heads
2214 2226 </a>
2215 2227 </td><td>
2216 2228 show branch heads
2217 2229 </td></tr>
2218 2230 <tr><td>
2219 2231 <a href="/help/help">
2220 2232 help
2221 2233 </a>
2222 2234 </td><td>
2223 2235 show help for a given topic or a help overview
2224 2236 </td></tr>
2225 2237 <tr><td>
2226 2238 <a href="/help/hgalias">
2227 2239 hgalias
2228 2240 </a>
2229 2241 </td><td>
2230 2242 summarize working directory state
2231 2243 </td></tr>
2232 2244 <tr><td>
2233 2245 <a href="/help/identify">
2234 2246 identify
2235 2247 </a>
2236 2248 </td><td>
2237 2249 identify the working directory or specified revision
2238 2250 </td></tr>
2239 2251 <tr><td>
2240 2252 <a href="/help/import">
2241 2253 import
2242 2254 </a>
2243 2255 </td><td>
2244 2256 import an ordered set of patches
2245 2257 </td></tr>
2246 2258 <tr><td>
2247 2259 <a href="/help/incoming">
2248 2260 incoming
2249 2261 </a>
2250 2262 </td><td>
2251 2263 show new changesets found in source
2252 2264 </td></tr>
2253 2265 <tr><td>
2254 2266 <a href="/help/manifest">
2255 2267 manifest
2256 2268 </a>
2257 2269 </td><td>
2258 2270 output the current or given revision of the project manifest
2259 2271 </td></tr>
2260 2272 <tr><td>
2261 2273 <a href="/help/nohelp">
2262 2274 nohelp
2263 2275 </a>
2264 2276 </td><td>
2265 2277 (no help text available)
2266 2278 </td></tr>
2267 2279 <tr><td>
2268 2280 <a href="/help/outgoing">
2269 2281 outgoing
2270 2282 </a>
2271 2283 </td><td>
2272 2284 show changesets not found in the destination
2273 2285 </td></tr>
2274 2286 <tr><td>
2275 2287 <a href="/help/paths">
2276 2288 paths
2277 2289 </a>
2278 2290 </td><td>
2279 2291 show aliases for remote repositories
2280 2292 </td></tr>
2281 2293 <tr><td>
2282 2294 <a href="/help/phase">
2283 2295 phase
2284 2296 </a>
2285 2297 </td><td>
2286 2298 set or show the current phase name
2287 2299 </td></tr>
2288 2300 <tr><td>
2289 2301 <a href="/help/recover">
2290 2302 recover
2291 2303 </a>
2292 2304 </td><td>
2293 2305 roll back an interrupted transaction
2294 2306 </td></tr>
2295 2307 <tr><td>
2296 2308 <a href="/help/rename">
2297 2309 rename
2298 2310 </a>
2299 2311 </td><td>
2300 2312 rename files; equivalent of copy + remove
2301 2313 </td></tr>
2302 2314 <tr><td>
2303 2315 <a href="/help/resolve">
2304 2316 resolve
2305 2317 </a>
2306 2318 </td><td>
2307 2319 redo merges or set/view the merge status of files
2308 2320 </td></tr>
2309 2321 <tr><td>
2310 2322 <a href="/help/revert">
2311 2323 revert
2312 2324 </a>
2313 2325 </td><td>
2314 2326 restore files to their checkout state
2315 2327 </td></tr>
2316 2328 <tr><td>
2317 2329 <a href="/help/root">
2318 2330 root
2319 2331 </a>
2320 2332 </td><td>
2321 2333 print the root (top) of the current working directory
2322 2334 </td></tr>
2323 2335 <tr><td>
2324 2336 <a href="/help/shellalias">
2325 2337 shellalias
2326 2338 </a>
2327 2339 </td><td>
2328 2340 (no help text available)
2329 2341 </td></tr>
2330 2342 <tr><td>
2331 2343 <a href="/help/tag">
2332 2344 tag
2333 2345 </a>
2334 2346 </td><td>
2335 2347 add one or more tags for the current or given revision
2336 2348 </td></tr>
2337 2349 <tr><td>
2338 2350 <a href="/help/tags">
2339 2351 tags
2340 2352 </a>
2341 2353 </td><td>
2342 2354 list repository tags
2343 2355 </td></tr>
2344 2356 <tr><td>
2345 2357 <a href="/help/unbundle">
2346 2358 unbundle
2347 2359 </a>
2348 2360 </td><td>
2349 2361 apply one or more changegroup files
2350 2362 </td></tr>
2351 2363 <tr><td>
2352 2364 <a href="/help/verify">
2353 2365 verify
2354 2366 </a>
2355 2367 </td><td>
2356 2368 verify the integrity of the repository
2357 2369 </td></tr>
2358 2370 <tr><td>
2359 2371 <a href="/help/version">
2360 2372 version
2361 2373 </a>
2362 2374 </td><td>
2363 2375 output version and copyright information
2364 2376 </td></tr>
2365 2377
2366 2378
2367 2379 </table>
2368 2380 </div>
2369 2381 </div>
2370 2382
2371 2383
2372 2384
2373 2385 </body>
2374 2386 </html>
2375 2387
2376 2388
2377 2389 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2378 2390 200 Script output follows
2379 2391
2380 2392 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2381 2393 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2382 2394 <head>
2383 2395 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2384 2396 <meta name="robots" content="index, nofollow" />
2385 2397 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2386 2398 <script type="text/javascript" src="/static/mercurial.js"></script>
2387 2399
2388 2400 <title>Help: add</title>
2389 2401 </head>
2390 2402 <body>
2391 2403
2392 2404 <div class="container">
2393 2405 <div class="menu">
2394 2406 <div class="logo">
2395 2407 <a href="https://mercurial-scm.org/">
2396 2408 <img src="/static/hglogo.png" alt="mercurial" /></a>
2397 2409 </div>
2398 2410 <ul>
2399 2411 <li><a href="/shortlog">log</a></li>
2400 2412 <li><a href="/graph">graph</a></li>
2401 2413 <li><a href="/tags">tags</a></li>
2402 2414 <li><a href="/bookmarks">bookmarks</a></li>
2403 2415 <li><a href="/branches">branches</a></li>
2404 2416 </ul>
2405 2417 <ul>
2406 2418 <li class="active"><a href="/help">help</a></li>
2407 2419 </ul>
2408 2420 </div>
2409 2421
2410 2422 <div class="main">
2411 2423 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2412 2424 <h3>Help: add</h3>
2413 2425
2414 2426 <form class="search" action="/log">
2415 2427
2416 2428 <p><input name="rev" id="search1" type="text" size="30" /></p>
2417 2429 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2418 2430 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2419 2431 </form>
2420 2432 <div id="doc">
2421 2433 <p>
2422 2434 hg add [OPTION]... [FILE]...
2423 2435 </p>
2424 2436 <p>
2425 2437 add the specified files on the next commit
2426 2438 </p>
2427 2439 <p>
2428 2440 Schedule files to be version controlled and added to the
2429 2441 repository.
2430 2442 </p>
2431 2443 <p>
2432 2444 The files will be added to the repository at the next commit. To
2433 2445 undo an add before that, see 'hg forget'.
2434 2446 </p>
2435 2447 <p>
2436 2448 If no names are given, add all files to the repository (except
2437 2449 files matching &quot;.hgignore&quot;).
2438 2450 </p>
2439 2451 <p>
2440 2452 Examples:
2441 2453 </p>
2442 2454 <ul>
2443 2455 <li> New (unknown) files are added automatically by 'hg add':
2444 2456 <pre>
2445 2457 \$ ls (re)
2446 2458 foo.c
2447 2459 \$ hg status (re)
2448 2460 ? foo.c
2449 2461 \$ hg add (re)
2450 2462 adding foo.c
2451 2463 \$ hg status (re)
2452 2464 A foo.c
2453 2465 </pre>
2454 2466 <li> Specific files to be added can be specified:
2455 2467 <pre>
2456 2468 \$ ls (re)
2457 2469 bar.c foo.c
2458 2470 \$ hg status (re)
2459 2471 ? bar.c
2460 2472 ? foo.c
2461 2473 \$ hg add bar.c (re)
2462 2474 \$ hg status (re)
2463 2475 A bar.c
2464 2476 ? foo.c
2465 2477 </pre>
2466 2478 </ul>
2467 2479 <p>
2468 2480 Returns 0 if all files are successfully added.
2469 2481 </p>
2470 2482 <p>
2471 2483 options ([+] can be repeated):
2472 2484 </p>
2473 2485 <table>
2474 2486 <tr><td>-I</td>
2475 2487 <td>--include PATTERN [+]</td>
2476 2488 <td>include names matching the given patterns</td></tr>
2477 2489 <tr><td>-X</td>
2478 2490 <td>--exclude PATTERN [+]</td>
2479 2491 <td>exclude names matching the given patterns</td></tr>
2480 2492 <tr><td>-S</td>
2481 2493 <td>--subrepos</td>
2482 2494 <td>recurse into subrepositories</td></tr>
2483 2495 <tr><td>-n</td>
2484 2496 <td>--dry-run</td>
2485 2497 <td>do not perform actions, just print output</td></tr>
2486 2498 </table>
2487 2499 <p>
2488 2500 global options ([+] can be repeated):
2489 2501 </p>
2490 2502 <table>
2491 2503 <tr><td>-R</td>
2492 2504 <td>--repository REPO</td>
2493 2505 <td>repository root directory or name of overlay bundle file</td></tr>
2494 2506 <tr><td></td>
2495 2507 <td>--cwd DIR</td>
2496 2508 <td>change working directory</td></tr>
2497 2509 <tr><td>-y</td>
2498 2510 <td>--noninteractive</td>
2499 2511 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2500 2512 <tr><td>-q</td>
2501 2513 <td>--quiet</td>
2502 2514 <td>suppress output</td></tr>
2503 2515 <tr><td>-v</td>
2504 2516 <td>--verbose</td>
2505 2517 <td>enable additional output</td></tr>
2506 2518 <tr><td></td>
2507 2519 <td>--config CONFIG [+]</td>
2508 2520 <td>set/override config option (use 'section.name=value')</td></tr>
2509 2521 <tr><td></td>
2510 2522 <td>--debug</td>
2511 2523 <td>enable debugging output</td></tr>
2512 2524 <tr><td></td>
2513 2525 <td>--debugger</td>
2514 2526 <td>start debugger</td></tr>
2515 2527 <tr><td></td>
2516 2528 <td>--encoding ENCODE</td>
2517 2529 <td>set the charset encoding (default: ascii)</td></tr>
2518 2530 <tr><td></td>
2519 2531 <td>--encodingmode MODE</td>
2520 2532 <td>set the charset encoding mode (default: strict)</td></tr>
2521 2533 <tr><td></td>
2522 2534 <td>--traceback</td>
2523 2535 <td>always print a traceback on exception</td></tr>
2524 2536 <tr><td></td>
2525 2537 <td>--time</td>
2526 2538 <td>time how long the command takes</td></tr>
2527 2539 <tr><td></td>
2528 2540 <td>--profile</td>
2529 2541 <td>print command execution profile</td></tr>
2530 2542 <tr><td></td>
2531 2543 <td>--version</td>
2532 2544 <td>output version information and exit</td></tr>
2533 2545 <tr><td>-h</td>
2534 2546 <td>--help</td>
2535 2547 <td>display help and exit</td></tr>
2536 2548 <tr><td></td>
2537 2549 <td>--hidden</td>
2538 2550 <td>consider hidden changesets</td></tr>
2539 2551 <tr><td></td>
2540 2552 <td>--pager TYPE</td>
2541 2553 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2542 2554 </table>
2543 2555
2544 2556 </div>
2545 2557 </div>
2546 2558 </div>
2547 2559
2548 2560
2549 2561
2550 2562 </body>
2551 2563 </html>
2552 2564
2553 2565
2554 2566 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2555 2567 200 Script output follows
2556 2568
2557 2569 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2558 2570 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2559 2571 <head>
2560 2572 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2561 2573 <meta name="robots" content="index, nofollow" />
2562 2574 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2563 2575 <script type="text/javascript" src="/static/mercurial.js"></script>
2564 2576
2565 2577 <title>Help: remove</title>
2566 2578 </head>
2567 2579 <body>
2568 2580
2569 2581 <div class="container">
2570 2582 <div class="menu">
2571 2583 <div class="logo">
2572 2584 <a href="https://mercurial-scm.org/">
2573 2585 <img src="/static/hglogo.png" alt="mercurial" /></a>
2574 2586 </div>
2575 2587 <ul>
2576 2588 <li><a href="/shortlog">log</a></li>
2577 2589 <li><a href="/graph">graph</a></li>
2578 2590 <li><a href="/tags">tags</a></li>
2579 2591 <li><a href="/bookmarks">bookmarks</a></li>
2580 2592 <li><a href="/branches">branches</a></li>
2581 2593 </ul>
2582 2594 <ul>
2583 2595 <li class="active"><a href="/help">help</a></li>
2584 2596 </ul>
2585 2597 </div>
2586 2598
2587 2599 <div class="main">
2588 2600 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2589 2601 <h3>Help: remove</h3>
2590 2602
2591 2603 <form class="search" action="/log">
2592 2604
2593 2605 <p><input name="rev" id="search1" type="text" size="30" /></p>
2594 2606 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2595 2607 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2596 2608 </form>
2597 2609 <div id="doc">
2598 2610 <p>
2599 2611 hg remove [OPTION]... FILE...
2600 2612 </p>
2601 2613 <p>
2602 2614 aliases: rm
2603 2615 </p>
2604 2616 <p>
2605 2617 remove the specified files on the next commit
2606 2618 </p>
2607 2619 <p>
2608 2620 Schedule the indicated files for removal from the current branch.
2609 2621 </p>
2610 2622 <p>
2611 2623 This command schedules the files to be removed at the next commit.
2612 2624 To undo a remove before that, see 'hg revert'. To undo added
2613 2625 files, see 'hg forget'.
2614 2626 </p>
2615 2627 <p>
2616 2628 -A/--after can be used to remove only files that have already
2617 2629 been deleted, -f/--force can be used to force deletion, and -Af
2618 2630 can be used to remove files from the next revision without
2619 2631 deleting them from the working directory.
2620 2632 </p>
2621 2633 <p>
2622 2634 The following table details the behavior of remove for different
2623 2635 file states (columns) and option combinations (rows). The file
2624 2636 states are Added [A], Clean [C], Modified [M] and Missing [!]
2625 2637 (as reported by 'hg status'). The actions are Warn, Remove
2626 2638 (from branch) and Delete (from disk):
2627 2639 </p>
2628 2640 <table>
2629 2641 <tr><td>opt/state</td>
2630 2642 <td>A</td>
2631 2643 <td>C</td>
2632 2644 <td>M</td>
2633 2645 <td>!</td></tr>
2634 2646 <tr><td>none</td>
2635 2647 <td>W</td>
2636 2648 <td>RD</td>
2637 2649 <td>W</td>
2638 2650 <td>R</td></tr>
2639 2651 <tr><td>-f</td>
2640 2652 <td>R</td>
2641 2653 <td>RD</td>
2642 2654 <td>RD</td>
2643 2655 <td>R</td></tr>
2644 2656 <tr><td>-A</td>
2645 2657 <td>W</td>
2646 2658 <td>W</td>
2647 2659 <td>W</td>
2648 2660 <td>R</td></tr>
2649 2661 <tr><td>-Af</td>
2650 2662 <td>R</td>
2651 2663 <td>R</td>
2652 2664 <td>R</td>
2653 2665 <td>R</td></tr>
2654 2666 </table>
2655 2667 <p>
2656 2668 <b>Note:</b>
2657 2669 </p>
2658 2670 <p>
2659 2671 'hg remove' never deletes files in Added [A] state from the
2660 2672 working directory, not even if &quot;--force&quot; is specified.
2661 2673 </p>
2662 2674 <p>
2663 2675 Returns 0 on success, 1 if any warnings encountered.
2664 2676 </p>
2665 2677 <p>
2666 2678 options ([+] can be repeated):
2667 2679 </p>
2668 2680 <table>
2669 2681 <tr><td>-A</td>
2670 2682 <td>--after</td>
2671 2683 <td>record delete for missing files</td></tr>
2672 2684 <tr><td>-f</td>
2673 2685 <td>--force</td>
2674 2686 <td>forget added files, delete modified files</td></tr>
2675 2687 <tr><td>-S</td>
2676 2688 <td>--subrepos</td>
2677 2689 <td>recurse into subrepositories</td></tr>
2678 2690 <tr><td>-I</td>
2679 2691 <td>--include PATTERN [+]</td>
2680 2692 <td>include names matching the given patterns</td></tr>
2681 2693 <tr><td>-X</td>
2682 2694 <td>--exclude PATTERN [+]</td>
2683 2695 <td>exclude names matching the given patterns</td></tr>
2684 2696 </table>
2685 2697 <p>
2686 2698 global options ([+] can be repeated):
2687 2699 </p>
2688 2700 <table>
2689 2701 <tr><td>-R</td>
2690 2702 <td>--repository REPO</td>
2691 2703 <td>repository root directory or name of overlay bundle file</td></tr>
2692 2704 <tr><td></td>
2693 2705 <td>--cwd DIR</td>
2694 2706 <td>change working directory</td></tr>
2695 2707 <tr><td>-y</td>
2696 2708 <td>--noninteractive</td>
2697 2709 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2698 2710 <tr><td>-q</td>
2699 2711 <td>--quiet</td>
2700 2712 <td>suppress output</td></tr>
2701 2713 <tr><td>-v</td>
2702 2714 <td>--verbose</td>
2703 2715 <td>enable additional output</td></tr>
2704 2716 <tr><td></td>
2705 2717 <td>--config CONFIG [+]</td>
2706 2718 <td>set/override config option (use 'section.name=value')</td></tr>
2707 2719 <tr><td></td>
2708 2720 <td>--debug</td>
2709 2721 <td>enable debugging output</td></tr>
2710 2722 <tr><td></td>
2711 2723 <td>--debugger</td>
2712 2724 <td>start debugger</td></tr>
2713 2725 <tr><td></td>
2714 2726 <td>--encoding ENCODE</td>
2715 2727 <td>set the charset encoding (default: ascii)</td></tr>
2716 2728 <tr><td></td>
2717 2729 <td>--encodingmode MODE</td>
2718 2730 <td>set the charset encoding mode (default: strict)</td></tr>
2719 2731 <tr><td></td>
2720 2732 <td>--traceback</td>
2721 2733 <td>always print a traceback on exception</td></tr>
2722 2734 <tr><td></td>
2723 2735 <td>--time</td>
2724 2736 <td>time how long the command takes</td></tr>
2725 2737 <tr><td></td>
2726 2738 <td>--profile</td>
2727 2739 <td>print command execution profile</td></tr>
2728 2740 <tr><td></td>
2729 2741 <td>--version</td>
2730 2742 <td>output version information and exit</td></tr>
2731 2743 <tr><td>-h</td>
2732 2744 <td>--help</td>
2733 2745 <td>display help and exit</td></tr>
2734 2746 <tr><td></td>
2735 2747 <td>--hidden</td>
2736 2748 <td>consider hidden changesets</td></tr>
2737 2749 <tr><td></td>
2738 2750 <td>--pager TYPE</td>
2739 2751 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2740 2752 </table>
2741 2753
2742 2754 </div>
2743 2755 </div>
2744 2756 </div>
2745 2757
2746 2758
2747 2759
2748 2760 </body>
2749 2761 </html>
2750 2762
2751 2763
2752 2764 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2753 2765 200 Script output follows
2754 2766
2755 2767 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2756 2768 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2757 2769 <head>
2758 2770 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2759 2771 <meta name="robots" content="index, nofollow" />
2760 2772 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2761 2773 <script type="text/javascript" src="/static/mercurial.js"></script>
2762 2774
2763 2775 <title>Help: dates</title>
2764 2776 </head>
2765 2777 <body>
2766 2778
2767 2779 <div class="container">
2768 2780 <div class="menu">
2769 2781 <div class="logo">
2770 2782 <a href="https://mercurial-scm.org/">
2771 2783 <img src="/static/hglogo.png" alt="mercurial" /></a>
2772 2784 </div>
2773 2785 <ul>
2774 2786 <li><a href="/shortlog">log</a></li>
2775 2787 <li><a href="/graph">graph</a></li>
2776 2788 <li><a href="/tags">tags</a></li>
2777 2789 <li><a href="/bookmarks">bookmarks</a></li>
2778 2790 <li><a href="/branches">branches</a></li>
2779 2791 </ul>
2780 2792 <ul>
2781 2793 <li class="active"><a href="/help">help</a></li>
2782 2794 </ul>
2783 2795 </div>
2784 2796
2785 2797 <div class="main">
2786 2798 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2787 2799 <h3>Help: dates</h3>
2788 2800
2789 2801 <form class="search" action="/log">
2790 2802
2791 2803 <p><input name="rev" id="search1" type="text" size="30" /></p>
2792 2804 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2793 2805 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2794 2806 </form>
2795 2807 <div id="doc">
2796 2808 <h1>Date Formats</h1>
2797 2809 <p>
2798 2810 Some commands allow the user to specify a date, e.g.:
2799 2811 </p>
2800 2812 <ul>
2801 2813 <li> backout, commit, import, tag: Specify the commit date.
2802 2814 <li> log, revert, update: Select revision(s) by date.
2803 2815 </ul>
2804 2816 <p>
2805 2817 Many date formats are valid. Here are some examples:
2806 2818 </p>
2807 2819 <ul>
2808 2820 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2809 2821 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2810 2822 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2811 2823 <li> &quot;Dec 6&quot; (midnight)
2812 2824 <li> &quot;13:18&quot; (today assumed)
2813 2825 <li> &quot;3:39&quot; (3:39AM assumed)
2814 2826 <li> &quot;3:39pm&quot; (15:39)
2815 2827 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2816 2828 <li> &quot;2006-12-6 13:18&quot;
2817 2829 <li> &quot;2006-12-6&quot;
2818 2830 <li> &quot;12-6&quot;
2819 2831 <li> &quot;12/6&quot;
2820 2832 <li> &quot;12/6/6&quot; (Dec 6 2006)
2821 2833 <li> &quot;today&quot; (midnight)
2822 2834 <li> &quot;yesterday&quot; (midnight)
2823 2835 <li> &quot;now&quot; - right now
2824 2836 </ul>
2825 2837 <p>
2826 2838 Lastly, there is Mercurial's internal format:
2827 2839 </p>
2828 2840 <ul>
2829 2841 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2830 2842 </ul>
2831 2843 <p>
2832 2844 This is the internal representation format for dates. The first number
2833 2845 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2834 2846 second is the offset of the local timezone, in seconds west of UTC
2835 2847 (negative if the timezone is east of UTC).
2836 2848 </p>
2837 2849 <p>
2838 2850 The log command also accepts date ranges:
2839 2851 </p>
2840 2852 <ul>
2841 2853 <li> &quot;&lt;DATE&quot; - at or before a given date/time
2842 2854 <li> &quot;&gt;DATE&quot; - on or after a given date/time
2843 2855 <li> &quot;DATE to DATE&quot; - a date range, inclusive
2844 2856 <li> &quot;-DAYS&quot; - within a given number of days of today
2845 2857 </ul>
2846 2858
2847 2859 </div>
2848 2860 </div>
2849 2861 </div>
2850 2862
2851 2863
2852 2864
2853 2865 </body>
2854 2866 </html>
2855 2867
2856 2868
2857 2869 Sub-topic indexes rendered properly
2858 2870
2859 2871 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
2860 2872 200 Script output follows
2861 2873
2862 2874 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2863 2875 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2864 2876 <head>
2865 2877 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2866 2878 <meta name="robots" content="index, nofollow" />
2867 2879 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2868 2880 <script type="text/javascript" src="/static/mercurial.js"></script>
2869 2881
2870 2882 <title>Help: internals</title>
2871 2883 </head>
2872 2884 <body>
2873 2885
2874 2886 <div class="container">
2875 2887 <div class="menu">
2876 2888 <div class="logo">
2877 2889 <a href="https://mercurial-scm.org/">
2878 2890 <img src="/static/hglogo.png" alt="mercurial" /></a>
2879 2891 </div>
2880 2892 <ul>
2881 2893 <li><a href="/shortlog">log</a></li>
2882 2894 <li><a href="/graph">graph</a></li>
2883 2895 <li><a href="/tags">tags</a></li>
2884 2896 <li><a href="/bookmarks">bookmarks</a></li>
2885 2897 <li><a href="/branches">branches</a></li>
2886 2898 </ul>
2887 2899 <ul>
2888 2900 <li><a href="/help">help</a></li>
2889 2901 </ul>
2890 2902 </div>
2891 2903
2892 2904 <div class="main">
2893 2905 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2894 2906 <form class="search" action="/log">
2895 2907
2896 2908 <p><input name="rev" id="search1" type="text" size="30" /></p>
2897 2909 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2898 2910 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2899 2911 </form>
2900 2912 <table class="bigtable">
2901 2913 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2902 2914
2903 2915 <tr><td>
2904 2916 <a href="/help/internals.bundles">
2905 2917 bundles
2906 2918 </a>
2907 2919 </td><td>
2908 2920 Bundles
2909 2921 </td></tr>
2910 2922 <tr><td>
2911 2923 <a href="/help/internals.changegroups">
2912 2924 changegroups
2913 2925 </a>
2914 2926 </td><td>
2915 2927 Changegroups
2916 2928 </td></tr>
2917 2929 <tr><td>
2918 2930 <a href="/help/internals.requirements">
2919 2931 requirements
2920 2932 </a>
2921 2933 </td><td>
2922 2934 Repository Requirements
2923 2935 </td></tr>
2924 2936 <tr><td>
2925 2937 <a href="/help/internals.revlogs">
2926 2938 revlogs
2927 2939 </a>
2928 2940 </td><td>
2929 2941 Revision Logs
2930 2942 </td></tr>
2931 2943 <tr><td>
2932 2944 <a href="/help/internals.wireprotocol">
2933 2945 wireprotocol
2934 2946 </a>
2935 2947 </td><td>
2936 2948 Wire Protocol
2937 2949 </td></tr>
2938 2950
2939 2951
2940 2952
2941 2953
2942 2954
2943 2955 </table>
2944 2956 </div>
2945 2957 </div>
2946 2958
2947 2959
2948 2960
2949 2961 </body>
2950 2962 </html>
2951 2963
2952 2964
2953 2965 Sub-topic topics rendered properly
2954 2966
2955 2967 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
2956 2968 200 Script output follows
2957 2969
2958 2970 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2959 2971 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2960 2972 <head>
2961 2973 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2962 2974 <meta name="robots" content="index, nofollow" />
2963 2975 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2964 2976 <script type="text/javascript" src="/static/mercurial.js"></script>
2965 2977
2966 2978 <title>Help: internals.changegroups</title>
2967 2979 </head>
2968 2980 <body>
2969 2981
2970 2982 <div class="container">
2971 2983 <div class="menu">
2972 2984 <div class="logo">
2973 2985 <a href="https://mercurial-scm.org/">
2974 2986 <img src="/static/hglogo.png" alt="mercurial" /></a>
2975 2987 </div>
2976 2988 <ul>
2977 2989 <li><a href="/shortlog">log</a></li>
2978 2990 <li><a href="/graph">graph</a></li>
2979 2991 <li><a href="/tags">tags</a></li>
2980 2992 <li><a href="/bookmarks">bookmarks</a></li>
2981 2993 <li><a href="/branches">branches</a></li>
2982 2994 </ul>
2983 2995 <ul>
2984 2996 <li class="active"><a href="/help">help</a></li>
2985 2997 </ul>
2986 2998 </div>
2987 2999
2988 3000 <div class="main">
2989 3001 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2990 3002 <h3>Help: internals.changegroups</h3>
2991 3003
2992 3004 <form class="search" action="/log">
2993 3005
2994 3006 <p><input name="rev" id="search1" type="text" size="30" /></p>
2995 3007 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2996 3008 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2997 3009 </form>
2998 3010 <div id="doc">
2999 3011 <h1>Changegroups</h1>
3000 3012 <p>
3001 3013 Changegroups are representations of repository revlog data, specifically
3002 3014 the changelog, manifest, and filelogs.
3003 3015 </p>
3004 3016 <p>
3005 3017 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3006 3018 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with
3007 3019 the only difference being a header on entries in the changeset
3008 3020 segment. Version &quot;3&quot; adds support for exchanging treemanifests and
3009 3021 includes revlog flags in the delta header.
3010 3022 </p>
3011 3023 <p>
3012 3024 Changegroups consists of 3 logical segments:
3013 3025 </p>
3014 3026 <pre>
3015 3027 +---------------------------------+
3016 3028 | | | |
3017 3029 | changeset | manifest | filelogs |
3018 3030 | | | |
3019 3031 +---------------------------------+
3020 3032 </pre>
3021 3033 <p>
3022 3034 The principle building block of each segment is a *chunk*. A *chunk*
3023 3035 is a framed piece of data:
3024 3036 </p>
3025 3037 <pre>
3026 3038 +---------------------------------------+
3027 3039 | | |
3028 3040 | length | data |
3029 3041 | (32 bits) | &lt;length&gt; bytes |
3030 3042 | | |
3031 3043 +---------------------------------------+
3032 3044 </pre>
3033 3045 <p>
3034 3046 Each chunk starts with a 32-bit big-endian signed integer indicating
3035 3047 the length of the raw data that follows.
3036 3048 </p>
3037 3049 <p>
3038 3050 There is a special case chunk that has 0 length (&quot;0x00000000&quot;). We
3039 3051 call this an *empty chunk*.
3040 3052 </p>
3041 3053 <h2>Delta Groups</h2>
3042 3054 <p>
3043 3055 A *delta group* expresses the content of a revlog as a series of deltas,
3044 3056 or patches against previous revisions.
3045 3057 </p>
3046 3058 <p>
3047 3059 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3048 3060 to signal the end of the delta group:
3049 3061 </p>
3050 3062 <pre>
3051 3063 +------------------------------------------------------------------------+
3052 3064 | | | | | |
3053 3065 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3054 3066 | (32 bits) | (various) | (32 bits) | (various) | (32 bits) |
3055 3067 | | | | | |
3056 3068 +------------------------------------------------------------+-----------+
3057 3069 </pre>
3058 3070 <p>
3059 3071 Each *chunk*'s data consists of the following:
3060 3072 </p>
3061 3073 <pre>
3062 3074 +-----------------------------------------+
3063 3075 | | | |
3064 3076 | delta header | mdiff header | delta |
3065 3077 | (various) | (12 bytes) | (various) |
3066 3078 | | | |
3067 3079 +-----------------------------------------+
3068 3080 </pre>
3069 3081 <p>
3070 3082 The *length* field is the byte length of the remaining 3 logical pieces
3071 3083 of data. The *delta* is a diff from an existing entry in the changelog.
3072 3084 </p>
3073 3085 <p>
3074 3086 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3075 3087 &quot;3&quot; of the changegroup format.
3076 3088 </p>
3077 3089 <p>
3078 3090 Version 1:
3079 3091 </p>
3080 3092 <pre>
3081 3093 +------------------------------------------------------+
3082 3094 | | | | |
3083 3095 | node | p1 node | p2 node | link node |
3084 3096 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3085 3097 | | | | |
3086 3098 +------------------------------------------------------+
3087 3099 </pre>
3088 3100 <p>
3089 3101 Version 2:
3090 3102 </p>
3091 3103 <pre>
3092 3104 +------------------------------------------------------------------+
3093 3105 | | | | | |
3094 3106 | node | p1 node | p2 node | base node | link node |
3095 3107 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3096 3108 | | | | | |
3097 3109 +------------------------------------------------------------------+
3098 3110 </pre>
3099 3111 <p>
3100 3112 Version 3:
3101 3113 </p>
3102 3114 <pre>
3103 3115 +------------------------------------------------------------------------------+
3104 3116 | | | | | | |
3105 3117 | node | p1 node | p2 node | base node | link node | flags |
3106 3118 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3107 3119 | | | | | | |
3108 3120 +------------------------------------------------------------------------------+
3109 3121 </pre>
3110 3122 <p>
3111 3123 The *mdiff header* consists of 3 32-bit big-endian signed integers
3112 3124 describing offsets at which to apply the following delta content:
3113 3125 </p>
3114 3126 <pre>
3115 3127 +-------------------------------------+
3116 3128 | | | |
3117 3129 | offset | old length | new length |
3118 3130 | (32 bits) | (32 bits) | (32 bits) |
3119 3131 | | | |
3120 3132 +-------------------------------------+
3121 3133 </pre>
3122 3134 <p>
3123 3135 In version 1, the delta is always applied against the previous node from
3124 3136 the changegroup or the first parent if this is the first entry in the
3125 3137 changegroup.
3126 3138 </p>
3127 3139 <p>
3128 3140 In version 2, the delta base node is encoded in the entry in the
3129 3141 changegroup. This allows the delta to be expressed against any parent,
3130 3142 which can result in smaller deltas and more efficient encoding of data.
3131 3143 </p>
3132 3144 <h2>Changeset Segment</h2>
3133 3145 <p>
3134 3146 The *changeset segment* consists of a single *delta group* holding
3135 3147 changelog data. It is followed by an *empty chunk* to denote the
3136 3148 boundary to the *manifests segment*.
3137 3149 </p>
3138 3150 <h2>Manifest Segment</h2>
3139 3151 <p>
3140 3152 The *manifest segment* consists of a single *delta group* holding
3141 3153 manifest data. It is followed by an *empty chunk* to denote the boundary
3142 3154 to the *filelogs segment*.
3143 3155 </p>
3144 3156 <h2>Filelogs Segment</h2>
3145 3157 <p>
3146 3158 The *filelogs* segment consists of multiple sub-segments, each
3147 3159 corresponding to an individual file whose data is being described:
3148 3160 </p>
3149 3161 <pre>
3150 3162 +--------------------------------------+
3151 3163 | | | | |
3152 3164 | filelog0 | filelog1 | filelog2 | ... |
3153 3165 | | | | |
3154 3166 +--------------------------------------+
3155 3167 </pre>
3156 3168 <p>
3157 3169 In version &quot;3&quot; of the changegroup format, filelogs may include
3158 3170 directory logs when treemanifests are in use. directory logs are
3159 3171 identified by having a trailing '/' on their filename (see below).
3160 3172 </p>
3161 3173 <p>
3162 3174 The final filelog sub-segment is followed by an *empty chunk* to denote
3163 3175 the end of the segment and the overall changegroup.
3164 3176 </p>
3165 3177 <p>
3166 3178 Each filelog sub-segment consists of the following:
3167 3179 </p>
3168 3180 <pre>
3169 3181 +------------------------------------------+
3170 3182 | | | |
3171 3183 | filename size | filename | delta group |
3172 3184 | (32 bits) | (various) | (various) |
3173 3185 | | | |
3174 3186 +------------------------------------------+
3175 3187 </pre>
3176 3188 <p>
3177 3189 That is, a *chunk* consisting of the filename (not terminated or padded)
3178 3190 followed by N chunks constituting the *delta group* for this file.
3179 3191 </p>
3180 3192
3181 3193 </div>
3182 3194 </div>
3183 3195 </div>
3184 3196
3185 3197
3186 3198
3187 3199 </body>
3188 3200 </html>
3189 3201
3190 3202
3191 3203 $ killdaemons.py
3192 3204
3193 3205 #endif
General Comments 0
You need to be logged in to leave comments. Login now