comparison mercurial/commands.py @ 9280:b694531a5aa7

commands: Check if helptext contains a newline before we split
author David Soria Parra <dsp@php.net>
date Mon, 27 Jul 2009 02:12:17 +0200
parents 16f4cfc69e4f
children 1ef630452e0b
comparison
equal deleted inserted replaced
9279:ca143d86727c 9280:b694531a5aa7
1553 mod = extensions.find(name) 1553 mod = extensions.find(name)
1554 except KeyError: 1554 except KeyError:
1555 raise error.UnknownCommand(name) 1555 raise error.UnknownCommand(name)
1556 1556
1557 doc = gettext(mod.__doc__) or _('no help text available') 1557 doc = gettext(mod.__doc__) or _('no help text available')
1558 head, tail = doc.split('\n', 1) 1558 if '\n' not in doc:
1559 head, tail = doc, ""
1560 else:
1561 head, tail = doc.split('\n', 1)
1559 ui.write(_('%s extension - %s\n\n') % (name.split('.')[-1], head)) 1562 ui.write(_('%s extension - %s\n\n') % (name.split('.')[-1], head))
1560 if tail: 1563 if tail:
1561 ui.write(minirst.format(tail, textwidth)) 1564 ui.write(minirst.format(tail, textwidth))
1562 ui.status('\n\n') 1565 ui.status('\n\n')
1563 1566