Mercurial > hg-stable
changeset 36778:a5891e94bfe1
releasenotes: allow notes for multiple directives in a single changeset
This problem was caught in da91e7309daf8ffc51bf3e6f4b2d8a16ef5af95a. This patch just makes sure there is no warning when we
encounter such a case.
Differential Revision: https://phab.mercurial-scm.org/D2254
author | Rishabh Madan <rishabhmadan96@gmail.com> |
---|---|
date | Sun, 04 Mar 2018 00:25:58 +0530 |
parents | 3fff6f30bd7f |
children | f7e3fe95b663 |
files | hgext/releasenotes.py tests/test-releasenotes-formatting.t |
diffstat | 2 files changed, 35 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/releasenotes.py Sun Mar 04 00:15:35 2018 +0530 +++ b/hgext/releasenotes.py Sun Mar 04 00:25:58 2018 +0530 @@ -324,6 +324,9 @@ if pblock['type'] == 'margin': continue + if pblock['type'] == 'admonition': + break + if pblock['type'] != 'paragraph': repo.ui.warn(_('changeset %s: unexpected block in release ' 'notes directive %s\n') % (ctx, directive))
--- a/tests/test-releasenotes-formatting.t Sun Mar 04 00:15:35 2018 +0530 +++ b/tests/test-releasenotes-formatting.t Sun Mar 04 00:25:58 2018 +0530 @@ -457,3 +457,35 @@ ------------------ First paragraph of fix 1. + + $ cd .. + +Using multiple admonitions in same changeset + + $ hg init relnotes-multiadmon + $ cd relnotes-multiadmon + + $ touch file1 + $ hg -q commit -A -l - << EOF + > commit 1 + > + > .. feature:: + > + > Details about new feature. + > + > .. perf:: + > + > Improves the execution by 2x + > EOF + + $ hg releasenotes -r . $TESTTMP/relnotes-multiple-admonitions + $ cat $TESTTMP/relnotes-multiple-admonitions + New Features + ============ + + * Details about new feature. + + Performance Improvements + ======================== + + * Improves the execution by 2x