Mercurial > hg
comparison tests/test-releasenotes-formatting.t @ 49519:943509a58d29
releasenotes: use re.MULTILINE mode when checking admonitions
Release note admonitions must start at the beginning of a line within
the changeset description:
.. admonitions::
The checkadmonitions function search for and validates admonitions.
Unfortunately, since the ctx.description is multi-line, the regex search
always fails unless the admonition is on the first line.
This changeset adds re.MULTILINE to the re.compile to make the re opbject
multi-line.
author | Craig Ozancin <c.ozancin@gmail.com> |
---|---|
date | Fri, 30 Sep 2022 09:05:48 -0600 |
parents | c701f616d852 |
children |
comparison
equal
deleted
inserted
replaced
49517:52464a20add0 | 49519:943509a58d29 |
---|---|
385 $ hg init check-flag | 385 $ hg init check-flag |
386 $ cd check-flag | 386 $ cd check-flag |
387 | 387 |
388 $ touch a | 388 $ touch a |
389 $ hg -q commit -A -l - << EOF | 389 $ hg -q commit -A -l - << EOF |
390 > commit 2 | |
391 > | |
390 > .. asf:: | 392 > .. asf:: |
391 > | 393 > |
392 > First paragraph under this admonition. | 394 > First paragraph under this admonition. |
393 > EOF | 395 > EOF |
394 | 396 |
395 Suggest similar admonition in place of the invalid one. | 397 Suggest similar admonition in place of the invalid one. |
396 | 398 |
397 $ hg releasenotes -r . -c | 399 $ hg releasenotes -r . -c |
398 Invalid admonition 'asf' present in changeset 4026fe9e1c20 | 400 Invalid admonition 'asf' present in changeset 99fa3c800c5e |
399 | 401 |
400 $ touch b | 402 $ touch b |
401 $ hg -q commit -A -l - << EOF | 403 $ hg -q commit -A -l - << EOF |
402 > .. fixes:: | 404 > .. fixes:: |
403 > | 405 > |
404 > First paragraph under this admonition. | 406 > First paragraph under this admonition. |
405 > EOF | 407 > EOF |
406 | 408 |
407 $ hg releasenotes -r . -c | 409 $ hg releasenotes -r . -c |
408 Invalid admonition 'fixes' present in changeset 0e7130d2705c | 410 Invalid admonition 'fixes' present in changeset 4737b1b5afd1 |
409 (did you mean fix?) | 411 (did you mean fix?) |
410 | 412 |
411 $ cd .. | 413 $ cd .. |
412 | 414 |
413 Usage of --list flag | 415 Usage of --list flag |