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