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