# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1260721639 -3600 # Node ID bc117ea4c95a1af154b070eb20adfbdfa6fa9306 # Parent 00ecb2bc005cc0d06faee118cd550634cb589590 do not assume that doc-strings are present. A couple of places in the code assumed that docstrings were set. This prevented hgsubversion from loading when Mercurial is run under `python -OO'. diff --git a/hgsubversion/__init__.py b/hgsubversion/__init__.py --- a/hgsubversion/__init__.py +++ b/hgsubversion/__init__.py @@ -77,7 +77,7 @@ def uisetup(ui): docvals = {'extension': 'hgsubversion'} for cmd, (generic, target, fixdoc, ppopts, opts) in wrapcmds.iteritems(): - if fixdoc: + if fixdoc and wrappers.generic.__doc__: docvals['command'] = cmd docvals['Command'] = cmd.capitalize() docvals['target'] = target diff --git a/hgsubversion/svncommands.py b/hgsubversion/svncommands.py --- a/hgsubversion/svncommands.py +++ b/hgsubversion/svncommands.py @@ -282,6 +282,9 @@ def _helpgen(): 'subcommands for Subversion integration', '', 'list of subcommands:', ''] for name, func in sorted(table.items()): - short_description = (func.__doc__ or '').splitlines()[0] + if func.__doc__: + short_description = func.__doc__.splitlines()[0] + else: + short_description = '' ret.append(" %-10s %s" % (name, short_description)) return '\n'.join(ret) + '\n'