# HG changeset patch # User Brendan Cully # Date 1183090585 25200 # Node ID c41a404ac38703113f0a759d4a0e1d7b088a350d # Parent 2ececafa58596042edcaeb93f0a35b9d3daa36ab Handle extensions with defined but empty cmdtable diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1395,6 +1395,8 @@ def help_(ui, name=None, with_version=Fa try: ct = mod.cmdtable except AttributeError: + ct = None + if not ct: ui.status(_('no commands defined\n')) return diff --git a/tests/test-extension b/tests/test-extension --- a/tests/test-extension +++ b/tests/test-extension @@ -53,3 +53,14 @@ echo '[extensions]' > $HGRCPATH echo "barfoo = $barfoopath" >> $HGRCPATH cd a hg foo + +cd .. +cat > empty.py < $HGRCPATH +echo "empty = $emptypath" >> $HGRCPATH +hg help empty diff --git a/tests/test-extension.out b/tests/test-extension.out --- a/tests/test-extension.out +++ b/tests/test-extension.out @@ -19,3 +19,6 @@ ui.parentui isnot None reposetup called for a ui == repo.ui Foo +empty extension - empty cmdtable + +no commands defined