mirror of
https://github.com/facebook/sapling.git
synced 2024-10-13 02:07:31 +03:00
editor: move exception data into RevisionData class
This commit is contained in:
parent
a8685ca30f
commit
9df31e8bd1
@ -36,8 +36,8 @@ def ieditor(fn):
|
||||
try:
|
||||
return fn(self, *args, **kwargs)
|
||||
except: #pragma: no cover
|
||||
if not hasattr(self, '_exception_info'):
|
||||
self._exception_info = sys.exc_info()
|
||||
if self.current.exception is not None:
|
||||
self.current.exception = sys.exc_info()
|
||||
raise
|
||||
return fun
|
||||
|
||||
@ -47,6 +47,7 @@ class RevisionData(object):
|
||||
__slots__ = [
|
||||
'file', 'files', 'deleted', 'rev', 'execfiles', 'symlinks', 'batons',
|
||||
'copies', 'missing', 'emptybranches', 'base', 'externals', 'ui',
|
||||
'exception',
|
||||
]
|
||||
|
||||
def __init__(self, ui):
|
||||
@ -67,6 +68,7 @@ class RevisionData(object):
|
||||
self.emptybranches = {}
|
||||
self.base = None
|
||||
self.externals = {}
|
||||
self.exception = None
|
||||
|
||||
def set(self, path, data, isexec=False, islink=False):
|
||||
if islink:
|
||||
@ -127,8 +129,8 @@ class HgEditor(delta.Editor):
|
||||
self.current.delete(path)
|
||||
|
||||
def commit_current_delta(self, tbdelta):
|
||||
if hasattr(self, '_exception_info'): #pragma: no cover
|
||||
traceback.print_exception(*self._exception_info)
|
||||
if self.current.exception is not None: #pragma: no cover
|
||||
traceback.print_exception(*self.current.exception)
|
||||
raise ReplayException()
|
||||
if self.current.missing:
|
||||
raise MissingPlainTextError()
|
||||
|
Loading…
Reference in New Issue
Block a user