Show More
@@ -275,6 +275,10 b' def checkadmonitions(ui, repo, directive' | |||||
275 | ss = ", ".join(sorted(similar)) |
|
275 | ss = ", ".join(sorted(similar)) | |
276 | ui.write(_("(did you mean one of %s?)\n") % ss) |
|
276 | ui.write(_("(did you mean one of %s?)\n") % ss) | |
277 |
|
277 | |||
|
278 | def _getadmonitionlist(ui, sections): | |||
|
279 | for section in sections: | |||
|
280 | ui.write("%s: %s\n" % (section[0], section[1])) | |||
|
281 | ||||
278 | def parsenotesfromrevisions(repo, directives, revs): |
|
282 | def parsenotesfromrevisions(repo, directives, revs): | |
279 | notes = parsedreleasenotes() |
|
283 | notes = parsedreleasenotes() | |
280 |
|
284 | |||
@@ -467,7 +471,9 b' def serializenotes(sections, notes):' | |||||
467 | @command('releasenotes', |
|
471 | @command('releasenotes', | |
468 | [('r', 'rev', '', _('revisions to process for release notes'), _('REV')), |
|
472 | [('r', 'rev', '', _('revisions to process for release notes'), _('REV')), | |
469 | ('c', 'check', False, _('checks for validity of admonitions (if any)'), |
|
473 | ('c', 'check', False, _('checks for validity of admonitions (if any)'), | |
470 |
_('REV')) |
|
474 | _('REV')), | |
|
475 | ('l', 'list', False, _('list the available admonitions with their title'), | |||
|
476 | None)], | |||
471 | _('hg releasenotes [-r REV] [-c] FILE')) |
|
477 | _('hg releasenotes [-r REV] [-c] FILE')) | |
472 | def releasenotes(ui, repo, file_=None, **opts): |
|
478 | def releasenotes(ui, repo, file_=None, **opts): | |
473 | """parse release notes from commit messages into an output file |
|
479 | """parse release notes from commit messages into an output file | |
@@ -546,8 +552,10 b' def releasenotes(ui, repo, file_=None, *' | |||||
546 | release note after it has been added to the release notes file. |
|
552 | release note after it has been added to the release notes file. | |
547 | """ |
|
553 | """ | |
548 | sections = releasenotessections(ui, repo) |
|
554 | sections = releasenotessections(ui, repo) | |
|
555 | if opts.get('list'): | |||
|
556 | return _getadmonitionlist(ui, sections) | |||
|
557 | ||||
549 | rev = opts.get('rev') |
|
558 | rev = opts.get('rev') | |
550 |
|
||||
551 | revs = scmutil.revrange(repo, [rev or 'not public()']) |
|
559 | revs = scmutil.revrange(repo, [rev or 'not public()']) | |
552 | if opts.get('check'): |
|
560 | if opts.get('check'): | |
553 | return checkadmonitions(ui, repo, sections.names(), revs) |
|
561 | return checkadmonitions(ui, repo, sections.names(), revs) |
@@ -407,3 +407,16 b' Suggest similar admonition in place of t' | |||||
407 | $ hg releasenotes -r . -c |
|
407 | $ hg releasenotes -r . -c | |
408 | Invalid admonition 'fixes' present in changeset 0e7130d2705c |
|
408 | Invalid admonition 'fixes' present in changeset 0e7130d2705c | |
409 | (did you mean fix?) |
|
409 | (did you mean fix?) | |
|
410 | ||||
|
411 | $ cd .. | |||
|
412 | ||||
|
413 | Usage of --list flag | |||
|
414 | ||||
|
415 | $ hg init relnotes-list | |||
|
416 | $ cd relnotes-list | |||
|
417 | $ hg releasenotes -l | |||
|
418 | feature: New Features | |||
|
419 | bc: Backwards Compatibility Changes | |||
|
420 | fix: Bug Fixes | |||
|
421 | perf: Performance Improvements | |||
|
422 | api: API Changes |
General Comments 0
You need to be logged in to leave comments.
Login now