# HG changeset patch # User Gregory Szorc # Date 2017-03-30 03:19:26 # Node ID bbf7a29dcf9b3c1c8ce285f5fae64027206739dc # Parent 32a563a01da45b547b9a999b0af3f735a636f790 minirst: remove redundant _admonitions set As Yuya pointed out during a review a month ago, _admonitions and _admonitiontitles are largely redundant. With the last commit, they are exactly redundant. So, remove _admonitions and use _admonitiontitles.keys() instead. diff --git a/mercurial/minirst.py b/mercurial/minirst.py --- a/mercurial/minirst.py +++ b/mercurial/minirst.py @@ -413,24 +413,12 @@ def prunecomments(blocks): return blocks -_admonitions = set([ - 'attention', - 'caution', - 'danger', - 'error', - 'hint', - 'important', - 'note', - 'tip', - 'warning', -]) - def findadmonitions(blocks, admonitions=None): """ Makes the type of the block an admonition block if the first line is an admonition directive """ - admonitions = admonitions or _admonitions + admonitions = admonitions or _admonitiontitles.keys() admonitionre = re.compile(br'\.\. (%s)::' % '|'.join(sorted(admonitions)), flags=re.IGNORECASE)