# HG changeset patch # User Matt Mackall # Date 1316284931 18000 # Node ID 9b41ccb2043e724690018f7cd25645dc5b980d51 # Parent efa213b14ec0dc15e8f9587b133fbb3acbb88e8e minirst: don't choke on empty text diff -r efa213b14ec0 -r 9b41ccb2043e mercurial/minirst.py --- a/mercurial/minirst.py Sat Sep 17 13:37:50 2011 -0500 +++ b/mercurial/minirst.py Sat Sep 17 13:42:11 2011 -0500 @@ -38,9 +38,10 @@ blocks = [] for b in _blockre.split(text.lstrip('\n').rstrip()): lines = b.splitlines() - indent = min((len(l) - len(l.lstrip())) for l in lines) - lines = [l[indent:] for l in lines] - blocks.append(dict(indent=indent, lines=lines)) + if lines: + indent = min((len(l) - len(l.lstrip())) for l in lines) + lines = [l[indent:] for l in lines] + blocks.append(dict(indent=indent, lines=lines)) return blocks def findliteralblocks(blocks):