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