mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
svncommand: Check traceback length to stop masking real exceptions.
This commit is contained in:
parent
2df035818d
commit
4d565525a9
@ -1,6 +1,8 @@
|
||||
import os
|
||||
import pickle
|
||||
import stat
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from mercurial import hg
|
||||
from mercurial import node
|
||||
@ -37,11 +39,18 @@ def svncmd(ui, repo, subcommand, *args, **opts):
|
||||
hg_repo_path=path,
|
||||
repo=repo,
|
||||
**opts)
|
||||
except TypeError, e:
|
||||
print e
|
||||
print 'Bad arguments for subcommand %s' % subcommand
|
||||
except TypeError:
|
||||
tb = traceback.extract_tb(sys.exc_info()[2])
|
||||
if len(tb) == 1:
|
||||
ui.status('Bad arguments for subcommand %s\n' % subcommand)
|
||||
else:
|
||||
raise
|
||||
except KeyError, e:
|
||||
print 'Unknown subcommand %s' % subcommand
|
||||
tb = traceback.extract_tb(sys.exc_info()[2])
|
||||
if len(tb) == 1:
|
||||
ui.status('Unknown subcommand %s\n' % subcommand)
|
||||
else:
|
||||
raise
|
||||
|
||||
@register_subcommand('help')
|
||||
def help_command(ui, args=None, **opts):
|
||||
|
Loading…
Reference in New Issue
Block a user