##// END OF EJS Templates
subrepo: add subrepo property to SubrepoAbort exceptions...
Angel Ezquerra -
r18263:9aa6bee6 default
parent child Browse files
Show More
@@ -16,6 +16,9 b" nullstate = ('', '', 'empty')"
16
16
17 class SubrepoAbort(error.Abort):
17 class SubrepoAbort(error.Abort):
18 """Exception class used to avoid handling a subrepo error more than once"""
18 """Exception class used to avoid handling a subrepo error more than once"""
19 def __init__(self, *args, **kw):
20 super(SubrepoAbort, self).__init__(*args, **kw)
21 self.subrepo = kw.get('subrepo')
19
22
20 def annotatesubrepoerror(func):
23 def annotatesubrepoerror(func):
21 def decoratedmethod(self, *args, **kargs):
24 def decoratedmethod(self, *args, **kargs):
@@ -25,9 +28,10 b' def annotatesubrepoerror(func):'
25 # This exception has already been handled
28 # This exception has already been handled
26 raise ex
29 raise ex
27 except error.Abort, ex:
30 except error.Abort, ex:
28 errormsg = _('%s (in subrepo %s)') % (str(ex), subrelpath(self))
31 subrepo = subrelpath(self)
32 errormsg = _('%s (in subrepo %s)') % (str(ex), subrepo)
29 # avoid handling this exception by raising a SubrepoAbort exception
33 # avoid handling this exception by raising a SubrepoAbort exception
30 raise SubrepoAbort(errormsg, hint=ex.hint)
34 raise SubrepoAbort(errormsg, hint=ex.hint, subrepo=subrepo)
31 return res
35 return res
32 return decoratedmethod
36 return decoratedmethod
33
37
General Comments 0
You need to be logged in to leave comments. Login now