# HG changeset patch # User Rishabh Madan # Date 1520103358 -19800 # Node ID a5891e94bfe1c026809be5a093f4199eff26c1f5 # Parent 3fff6f30bd7ff961efbc1e16ef95ba221d3bcfef 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 diff -r 3fff6f30bd7f -r a5891e94bfe1 hgext/releasenotes.py --- 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)) diff -r 3fff6f30bd7f -r a5891e94bfe1 tests/test-releasenotes-formatting.t --- 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