style: prevent the style hook from aborting uncleanly because of an exception

This commit is contained in:
Nathan Binkert 2011-01-10 11:11:16 -08:00
parent 3c8cc170d2
commit fcc621ac79

View file

@ -341,12 +341,24 @@ def check_hook(hooktype):
def check_style(ui, repo, hooktype, **kwargs): def check_style(ui, repo, hooktype, **kwargs):
check_hook(hooktype) check_hook(hooktype)
args = {} args = {}
return do_check_style(ui, repo, **args)
try:
return do_check_style(ui, repo, **args)
except Exception, e:
import traceback
traceback.print_exc()
return True
def check_format(ui, repo, hooktype, **kwargs): def check_format(ui, repo, hooktype, **kwargs):
check_hook(hooktype) check_hook(hooktype)
args = {} args = {}
return do_check_format(ui, repo, **args)
try:
return do_check_format(ui, repo, **args)
except Exception, e:
import traceback
traceback.print_exc()
return True
try: try:
from mercurial.i18n import _ from mercurial.i18n import _