# HG changeset patch # User David Soria Parra # Date 1248653537 -7200 # Node ID b694531a5aa79348f44d1f39be856c4a3e356c93 # Parent ca143d86727cdf7cfc079b6fc9a1eb09eed2dc72 commands: Check if helptext contains a newline before we split diff -r ca143d86727c -r b694531a5aa7 mercurial/commands.py --- a/mercurial/commands.py Sun Jul 26 02:33:38 2009 +0200 +++ b/mercurial/commands.py Mon Jul 27 02:12:17 2009 +0200 @@ -1555,7 +1555,10 @@ raise error.UnknownCommand(name) doc = gettext(mod.__doc__) or _('no help text available') - head, tail = doc.split('\n', 1) + if '\n' not in doc: + head, tail = doc, "" + else: + head, tail = doc.split('\n', 1) ui.write(_('%s extension - %s\n\n') % (name.split('.')[-1], head)) if tail: ui.write(minirst.format(tail, textwidth))