# HG changeset patch # User Matt Mackall # Date 1312324905 18000 # Node ID 4a1e3c761ec78affd19a0a399df2fe64064f8ba7 # Parent ee766af457ed4d71b925c1e5aef2b7002e9e23e3 minirst: add formatblocks helper diff -r ee766af457ed -r 4a1e3c761ec7 mercurial/minirst.py --- a/mercurial/minirst.py Tue Aug 02 14:54:38 2011 -0500 +++ b/mercurial/minirst.py Tue Aug 02 17:41:45 2011 -0500 @@ -452,6 +452,10 @@ blocks = findadmonitions(blocks) return blocks, pruned +def formatblocks(blocks, width): + text = '\n'.join(formatblock(b, width) for b in blocks) + return text + def format(text, width, indent=0, keep=None): """Parse and format the text according to width.""" blocks, pruned = parse(text, indent, keep or [])