# HG changeset patch # User Martin Geisler # Date 1257453050 -3600 # Node ID 97d0d910fa5d6a49302d76ac3f72667cea58ca31 # Parent 36c388a1aa5162ef6acb7c699db5389b1ef13235 minirst: remove unnecessary "elif:" statements diff -r 36c388a1aa51 -r 97d0d910fa5d mercurial/minirst.py --- a/mercurial/minirst.py Sat Nov 07 01:46:27 2009 +0100 +++ b/mercurial/minirst.py Thu Nov 05 21:30:50 2009 +0100 @@ -291,30 +291,29 @@ indent = ' ' * block['indent'] if block['type'] == 'margin': return '' - elif block['type'] == 'literal': + if block['type'] == 'literal': indent += ' ' return indent + ('\n' + indent).join(block['lines']) - elif block['type'] == 'section': + if block['type'] == 'section': return indent + ('\n' + indent).join(block['lines']) - elif block['type'] == 'definition': + if block['type'] == 'definition': term = indent + block['lines'][0] defindent = indent + block['hang'] * ' ' text = ' '.join(map(str.strip, block['lines'][1:])) return "%s\n%s" % (term, textwrap.fill(text, width=width, initial_indent=defindent, subsequent_indent=defindent)) - else: - initindent = subindent = indent - text = ' '.join(map(str.strip, block['lines'])) - if block['type'] == 'bullet': - initindent = indent + '- ' - subindent = indent + ' ' - elif block['type'] in ('option', 'field'): - subindent = indent + block['width'] * ' ' + initindent = subindent = indent + text = ' '.join(map(str.strip, block['lines'])) + if block['type'] == 'bullet': + initindent = indent + '- ' + subindent = indent + ' ' + elif block['type'] in ('option', 'field'): + subindent = indent + block['width'] * ' ' - return textwrap.fill(text, width=width, - initial_indent=initindent, - subsequent_indent=subindent) + return textwrap.fill(text, width=width, + initial_indent=initindent, + subsequent_indent=subindent) def format(text, width, indent=0):