mercurial/localrepo.py
changeset 2335 f0680b2d1d64
parent 2320 dbdce3b99988
child 2339 11422943cf72
equal deleted inserted replaced
2334:737deea2442c 2335:f0680b2d1d64
    10 from node import *
    10 from node import *
    11 from i18n import gettext as _
    11 from i18n import gettext as _
    12 from demandload import *
    12 from demandload import *
    13 demandload(globals(), "appendfile changegroup")
    13 demandload(globals(), "appendfile changegroup")
    14 demandload(globals(), "re lock transaction tempfile stat mdiff errno ui")
    14 demandload(globals(), "re lock transaction tempfile stat mdiff errno ui")
    15 demandload(globals(), "revlog traceback")
    15 demandload(globals(), "revlog")
    16 
    16 
    17 class localrepository(object):
    17 class localrepository(object):
    18     def __del__(self):
    18     def __del__(self):
    19         self.transhandle = None
    19         self.transhandle = None
    20     def __init__(self, parentui, path=None, create=0):
    20     def __init__(self, parentui, path=None, create=0):
   123                 else:
   123                 else:
   124                     self.ui.warn(_('error: %s hook raised an exception: '
   124                     self.ui.warn(_('error: %s hook raised an exception: '
   125                                    '%s\n') % (hname, exc))
   125                                    '%s\n') % (hname, exc))
   126                 if throw:
   126                 if throw:
   127                     raise
   127                     raise
   128                 if self.ui.traceback:
   128                 self.ui.print_exc()
   129                     traceback.print_exc()
       
   130                 return True
   129                 return True
   131             if r:
   130             if r:
   132                 if throw:
   131                 if throw:
   133                     raise util.Abort(_('%s hook failed') % hname)
   132                     raise util.Abort(_('%s hook failed') % hname)
   134                 self.ui.warn(_('warning: %s hook failed\n') % hname)
   133                 self.ui.warn(_('warning: %s hook failed\n') % hname)