comparison mercurial/help.py @ 22162:7ada34676db8

help: provide help of bad alias without executing aliascmd() The output is slightly changed because of minirst formatting. Previously, ui.pushbuffer() had no effect because "badalias" message was written to stderr. "if not unknowncmd" should no longer be needed because there's no call loop.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 13 Aug 2014 19:38:47 +0900
parents 645457f73aa6
children c5df4af17110
comparison
equal deleted inserted replaced
22161:063628423fd1 22162:7ada34676db8
234 234
235 rst = [] 235 rst = []
236 236
237 # check if it's an invalid alias and display its error if it is 237 # check if it's an invalid alias and display its error if it is
238 if getattr(entry[0], 'badalias', None): 238 if getattr(entry[0], 'badalias', None):
239 if not unknowncmd: 239 rst.append(entry[0].badalias + '\n')
240 ui.pushbuffer() 240 if entry[0].unknowncmd:
241 entry[0](ui) 241 try:
242 rst.append(ui.popbuffer()) 242 rst.extend(helpextcmd(entry[0].cmdname))
243 except error.UnknownCommand:
244 pass
243 return rst 245 return rst
244 246
245 # synopsis 247 # synopsis
246 if len(entry) > 2: 248 if len(entry) > 2:
247 if entry[2].startswith('hg'): 249 if entry[2].startswith('hg'):