Mercurial > hg
comparison mercurial/dispatch.py @ 26364:6e9c2aab9925
dispatch: don't stack trace on commands like `hg .log`
This used to stack trace because it raised a util.Abort which wasn't
handled in this block. We now handle it. Additionally, we error out
earlier instead of plodding on and showing the "log" entry of the
plain `hg help` output.
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Fri, 25 Sep 2015 11:16:20 -0400 |
parents | ccab61d84ea7 |
children | 4b0fc75f9403 |
comparison
equal
deleted
inserted
replaced
26363:f29ee23bf361 | 26364:6e9c2aab9925 |
---|---|
251 ui.warn(_("hg: unknown command '%s'\n") % inst.args[0]) | 251 ui.warn(_("hg: unknown command '%s'\n") % inst.args[0]) |
252 try: | 252 try: |
253 # check if the command is in a disabled extension | 253 # check if the command is in a disabled extension |
254 # (but don't check for extensions themselves) | 254 # (but don't check for extensions themselves) |
255 commands.help_(ui, inst.args[0], unknowncmd=True) | 255 commands.help_(ui, inst.args[0], unknowncmd=True) |
256 except error.UnknownCommand: | 256 except (error.UnknownCommand, util.Abort): |
257 suggested = False | 257 suggested = False |
258 if len(inst.args) == 2: | 258 if len(inst.args) == 2: |
259 sim = _getsimilar(inst.args[1], inst.args[0]) | 259 sim = _getsimilar(inst.args[1], inst.args[0]) |
260 if sim: | 260 if sim: |
261 ui.warn(_('(did you mean one of %s?)\n') % | 261 ui.warn(_('(did you mean one of %s?)\n') % |