mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
alias: do not crash when aliased command has no usage help text
This commit is contained in:
parent
a7bf3f1ac6
commit
686db2d57f
@ -196,7 +196,12 @@ class cmdalias(object):
|
||||
cmd = args.pop(0)
|
||||
|
||||
try:
|
||||
self.fn, self.opts, self.help = cmdutil.findcmd(cmd, cmdtable, False)[1]
|
||||
tableentry = cmdutil.findcmd(cmd, cmdtable, False)[1]
|
||||
if len(tableentry) > 2:
|
||||
self.fn, self.opts, self.help = tableentry
|
||||
else:
|
||||
self.fn, self.opts = tableentry
|
||||
|
||||
self.args = aliasargs(self.fn) + args
|
||||
if cmd not in commands.norepo.split(' '):
|
||||
self.norepo = False
|
||||
|
@ -12,6 +12,7 @@ mylog = log
|
||||
lognull = log -r null
|
||||
shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
|
||||
dln = lognull --debug
|
||||
nousage = rollback
|
||||
|
||||
[defaults]
|
||||
mylog = -q
|
||||
@ -35,6 +36,10 @@ echo '% no definition'
|
||||
hg nodef
|
||||
|
||||
cd alias
|
||||
|
||||
echo '% no usage'
|
||||
hg nousage
|
||||
|
||||
echo foo > foo
|
||||
hg ci -Amfoo
|
||||
|
||||
|
@ -7,6 +7,8 @@ alias 'ambiguous' resolves to ambiguous command 's'
|
||||
alias 'recursive' resolves to unknown command 'recursive'
|
||||
% no definition
|
||||
no definition for alias 'nodefinition'
|
||||
% no usage
|
||||
no rollback information available
|
||||
adding foo
|
||||
% with opts
|
||||
C foo
|
||||
|
Loading…
Reference in New Issue
Block a user