comparison hgext/releasenotes.py @ 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 2e726c934fcd
children de9ffb82ef4d
comparison
equal deleted inserted replaced
49517:52464a20add0 49519:943509a58d29
68 (b'fix', _(b'Bug Fixes')), 68 (b'fix', _(b'Bug Fixes')),
69 (b'perf', _(b'Performance Improvements')), 69 (b'perf', _(b'Performance Improvements')),
70 (b'api', _(b'API Changes')), 70 (b'api', _(b'API Changes')),
71 ] 71 ]
72 72
73 RE_DIRECTIVE = re.compile(br'^\.\. ([a-zA-Z0-9_]+)::\s*([^$]+)?$') 73 RE_DIRECTIVE = re.compile(br'^\.\. ([a-zA-Z0-9_]+)::\s*([^$]+)?$', re.MULTILINE)
74 RE_ISSUE = br'\bissue ?[0-9]{4,6}(?![0-9])\b' 74 RE_ISSUE = br'\bissue ?[0-9]{4,6}(?![0-9])\b'
75 75
76 BULLET_SECTION = _(b'Other Changes') 76 BULLET_SECTION = _(b'Other Changes')
77 77
78 78