# HG changeset patch # User Yuya Nishihara # Date 1533438367 -32400 # Node ID 9b800601701ca156dd90789b8d0e6a540e5e1a57 # Parent 92e9aa38a5782d58b24d914c466a66e8c1c72353 help: inline minirst.format() I'm going to make minirst.format() always returns a formatted text, not text | (text, pruned). diff -r 92e9aa38a578 -r 9b800601701c mercurial/help.py --- a/mercurial/help.py Sun Aug 05 11:43:05 2018 +0900 +++ b/mercurial/help.py Sun Aug 05 12:06:07 2018 +0900 @@ -672,8 +672,10 @@ text = help_(ui, commands, name, subtopic=subtopic, unknowncmd=unknowncmd, full=full, **opts) - formatted, pruned = minirst.format(text, textwidth, keep=keep, - section=section) + blocks, pruned = minirst.parse(text, keep=keep) + if section: + blocks = minirst.filtersections(blocks, section) + formatted = minirst.formatplain(blocks, textwidth) # We could have been given a weird ".foo" section without a name # to look for, or we could have simply failed to found "foo.bar" @@ -685,6 +687,7 @@ keep.append('omitted') else: keep.append('notomitted') - formatted, pruned = minirst.format(text, textwidth, keep=keep, - section=section) - return formatted + blocks, pruned = minirst.parse(text, keep=keep) + if section: + blocks = minirst.filtersections(blocks, section) + return minirst.formatplain(blocks, textwidth)