comparison mercurial/commands.py @ 4009:86098ec4b77a

fix hg help <ext> for extension that do not define any command solve issue462
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 26 Dec 2006 21:59:01 +0100
parents 3c82ab166eea
children e282448d68f1
comparison
equal deleted inserted replaced
4008:6e0cb0790e23 4009:86098ec4b77a
1343 ui.write(_('%s extension - %s\n') % (name.split('.')[-1], doc[0])) 1343 ui.write(_('%s extension - %s\n') % (name.split('.')[-1], doc[0]))
1344 for d in doc[1:]: 1344 for d in doc[1:]:
1345 ui.write(d, '\n') 1345 ui.write(d, '\n')
1346 1346
1347 ui.status('\n') 1347 ui.status('\n')
1348
1349 try:
1350 ct = mod.cmdtable
1351 except AttributeError:
1352 ui.status(_('no commands defined\n'))
1353 return
1354
1348 if ui.verbose: 1355 if ui.verbose:
1349 ui.status(_('list of commands:\n\n')) 1356 ui.status(_('list of commands:\n\n'))
1350 else: 1357 else:
1351 ui.status(_('list of commands (use "hg help -v %s" ' 1358 ui.status(_('list of commands (use "hg help -v %s" '
1352 'to show aliases and global options):\n\n') % name) 1359 'to show aliases and global options):\n\n') % name)
1353 1360
1354 modcmds = dict.fromkeys([c.split('|', 1)[0] for c in mod.cmdtable]) 1361 modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct])
1355 helplist(modcmds.has_key) 1362 helplist(modcmds.has_key)
1356 1363
1357 if name and name != 'shortlist': 1364 if name and name != 'shortlist':
1358 i = None 1365 i = None
1359 for f in (helpcmd, helptopic, helpext): 1366 for f in (helpcmd, helptopic, helpext):