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