hgext/bugzilla.py
changeset 25660 328739ea70c3
parent 25186 80c5b2666a96
child 26587 56b2bcea2529
equal deleted inserted replaced
25659:d60678a567a9 25660:328739ea70c3
   355 
   355 
   356     def __init__(self, ui):
   356     def __init__(self, ui):
   357         try:
   357         try:
   358             import MySQLdb as mysql
   358             import MySQLdb as mysql
   359             bzmysql._MySQLdb = mysql
   359             bzmysql._MySQLdb = mysql
   360         except ImportError, err:
   360         except ImportError as err:
   361             raise util.Abort(_('python mysql support not available: %s') % err)
   361             raise util.Abort(_('python mysql support not available: %s') % err)
   362 
   362 
   363         bzaccess.__init__(self, ui)
   363         bzaccess.__init__(self, ui)
   364 
   364 
   365         host = self.ui.config('bugzilla', 'host', 'localhost')
   365         host = self.ui.config('bugzilla', 'host', 'localhost')
   908         bugs = bz.find_bugs(ctx)
   908         bugs = bz.find_bugs(ctx)
   909         if bugs:
   909         if bugs:
   910             for bug in bugs:
   910             for bug in bugs:
   911                 bz.update(bug, bugs[bug], ctx)
   911                 bz.update(bug, bugs[bug], ctx)
   912             bz.notify(bugs, util.email(ctx.user()))
   912             bz.notify(bugs, util.email(ctx.user()))
   913     except Exception, e:
   913     except Exception as e:
   914         raise util.Abort(_('Bugzilla error: %s') % e)
   914         raise util.Abort(_('Bugzilla error: %s') % e)