changeset 31719:bbf7a29dcf9b

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.
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 29 Mar 2017 20:19:26 -0700
parents 32a563a01da4
children 6c80f985a13c
files mercurial/minirst.py
diffstat 1 files changed, 1 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/minirst.py	Wed Mar 29 20:05:18 2017 -0700
+++ b/mercurial/minirst.py	Wed Mar 29 20:19:26 2017 -0700
@@ -413,24 +413,12 @@
     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)