##// END OF EJS Templates
alias: exit from bad definition by Abort
Yuya Nishihara -
r22164:efd65e51 default
parent child Browse files
Show More
@@ -443,16 +443,15 b' class cmdalias(object):'
443
443
444 def __call__(self, ui, *args, **opts):
444 def __call__(self, ui, *args, **opts):
445 if self.badalias:
445 if self.badalias:
446 ui.warn(self.badalias + '\n')
446 hint = None
447 if self.unknowncmd:
447 if self.unknowncmd:
448 try:
448 try:
449 # check if the command is in a disabled extension
449 # check if the command is in a disabled extension
450 cmd, ext = extensions.disabledcmd(ui, self.cmdname)[:2]
450 cmd, ext = extensions.disabledcmd(ui, self.cmdname)[:2]
451 ui.warn(_("'%s' is provided by '%s' extension\n")
451 hint = _("'%s' is provided by '%s' extension") % (cmd, ext)
452 % (cmd, ext))
453 except error.UnknownCommand:
452 except error.UnknownCommand:
454 pass
453 pass
455 return -1
454 raise util.Abort(self.badalias, hint=hint)
456 if self.shadows:
455 if self.shadows:
457 ui.debug("alias '%s' shadows command '%s'\n" %
456 ui.debug("alias '%s' shadows command '%s'\n" %
458 (self.name, self.cmdname))
457 (self.name, self.cmdname))
@@ -62,7 +62,7 b' basic'
62 unknown
62 unknown
63
63
64 $ hg unknown
64 $ hg unknown
65 alias 'unknown' resolves to unknown command 'bargle'
65 abort: alias 'unknown' resolves to unknown command 'bargle'
66 [255]
66 [255]
67 $ hg help unknown
67 $ hg help unknown
68 alias 'unknown' resolves to unknown command 'bargle'
68 alias 'unknown' resolves to unknown command 'bargle'
@@ -71,7 +71,7 b' unknown'
71 ambiguous
71 ambiguous
72
72
73 $ hg ambiguous
73 $ hg ambiguous
74 alias 'ambiguous' resolves to ambiguous command 's'
74 abort: alias 'ambiguous' resolves to ambiguous command 's'
75 [255]
75 [255]
76 $ hg help ambiguous
76 $ hg help ambiguous
77 alias 'ambiguous' resolves to ambiguous command 's'
77 alias 'ambiguous' resolves to ambiguous command 's'
@@ -80,7 +80,7 b' ambiguous'
80 recursive
80 recursive
81
81
82 $ hg recursive
82 $ hg recursive
83 alias 'recursive' resolves to unknown command 'recursive'
83 abort: alias 'recursive' resolves to unknown command 'recursive'
84 [255]
84 [255]
85 $ hg help recursive
85 $ hg help recursive
86 alias 'recursive' resolves to unknown command 'recursive'
86 alias 'recursive' resolves to unknown command 'recursive'
@@ -89,8 +89,8 b' recursive'
89 disabled
89 disabled
90
90
91 $ hg disabled
91 $ hg disabled
92 alias 'disabled' resolves to unknown command 'email'
92 abort: alias 'disabled' resolves to unknown command 'email'
93 'email' is provided by 'patchbomb' extension
93 ('email' is provided by 'patchbomb' extension)
94 [255]
94 [255]
95 $ hg help disabled
95 $ hg help disabled
96 alias 'disabled' resolves to unknown command 'email'
96 alias 'disabled' resolves to unknown command 'email'
@@ -105,7 +105,7 b' disabled'
105 no definition
105 no definition
106
106
107 $ hg nodef
107 $ hg nodef
108 no definition for alias 'nodefinition'
108 abort: no definition for alias 'nodefinition'
109 [255]
109 [255]
110 $ hg help nodef
110 $ hg help nodef
111 no definition for alias 'nodefinition'
111 no definition for alias 'nodefinition'
@@ -114,7 +114,7 b' no definition'
114 no closing quotation
114 no closing quotation
115
115
116 $ hg noclosing
116 $ hg noclosing
117 error in definition for alias 'noclosingquotation': No closing quotation
117 abort: error in definition for alias 'noclosingquotation': No closing quotation
118 [255]
118 [255]
119 $ hg help noclosing
119 $ hg help noclosing
120 error in definition for alias 'noclosingquotation': No closing quotation
120 error in definition for alias 'noclosingquotation': No closing quotation
@@ -123,30 +123,30 b' no closing quotation'
123 invalid options
123 invalid options
124
124
125 $ hg no--cwd
125 $ hg no--cwd
126 error in definition for alias 'no--cwd': --cwd may only be given on the command line
126 abort: error in definition for alias 'no--cwd': --cwd may only be given on the command line
127 [255]
127 [255]
128 $ hg help no--cwd
128 $ hg help no--cwd
129 error in definition for alias 'no--cwd': --cwd may only be given on the
129 error in definition for alias 'no--cwd': --cwd may only be given on the
130 command line
130 command line
131 $ hg no-R
131 $ hg no-R
132 error in definition for alias 'no-R': -R may only be given on the command line
132 abort: error in definition for alias 'no-R': -R may only be given on the command line
133 [255]
133 [255]
134 $ hg help no-R
134 $ hg help no-R
135 error in definition for alias 'no-R': -R may only be given on the command line
135 error in definition for alias 'no-R': -R may only be given on the command line
136 $ hg no--repo
136 $ hg no--repo
137 error in definition for alias 'no--repo': --repo may only be given on the command line
137 abort: error in definition for alias 'no--repo': --repo may only be given on the command line
138 [255]
138 [255]
139 $ hg help no--repo
139 $ hg help no--repo
140 error in definition for alias 'no--repo': --repo may only be given on the
140 error in definition for alias 'no--repo': --repo may only be given on the
141 command line
141 command line
142 $ hg no--repository
142 $ hg no--repository
143 error in definition for alias 'no--repository': --repository may only be given on the command line
143 abort: error in definition for alias 'no--repository': --repository may only be given on the command line
144 [255]
144 [255]
145 $ hg help no--repository
145 $ hg help no--repository
146 error in definition for alias 'no--repository': --repository may only be given
146 error in definition for alias 'no--repository': --repository may only be given
147 on the command line
147 on the command line
148 $ hg no--config
148 $ hg no--config
149 error in definition for alias 'no--config': --config may only be given on the command line
149 abort: error in definition for alias 'no--config': --config may only be given on the command line
150 [255]
150 [255]
151
151
152 optional repository
152 optional repository
General Comments 0
You need to be logged in to leave comments. Login now