mercurial/crew

changeset 10292:ea7a14ca118a

bugzilla: lowercase mysqldb var
author Matt Mackall <mpm@selenic.com>
date Thu Jan 28 22:45:04 2010 -0600 (6 months ago)
parents 61c93743fae0
children cade47dcac2d
files hgext/bugzilla.py
line diff
     1.1 --- a/hgext/bugzilla.py
     1.2 +++ b/hgext/bugzilla.py
     1.3 @@ -145,7 +145,7 @@
     1.4  from mercurial import cmdutil, templater, util
     1.5  import re, time
     1.6  
     1.7 -MySQLdb = None
     1.8 +mysqldb = None
     1.9  
    1.10  def buglist(ids):
    1.11      return '(' + ','.join(map(str, ids)) + ')'
    1.12 @@ -165,7 +165,7 @@
    1.13              self.ui.readconfig(usermap, sections=['usermap'])
    1.14          self.ui.note(_('connecting to %s:%s as %s, password %s\n') %
    1.15                       (host, db, user, '*' * len(passwd)))
    1.16 -        self.conn = MySQLdb.connect(host=host, user=user, passwd=passwd,
    1.17 +        self.conn = mysqldb.connect(host=host, user=user, passwd=passwd,
    1.18                                      db=db, connect_timeout=timeout)
    1.19          self.cursor = self.conn.cursor()
    1.20          self.longdesc_id = self.get_longdesc_id()
    1.21 @@ -177,7 +177,7 @@
    1.22          self.ui.note(_('query: %s %s\n') % (args, kwargs))
    1.23          try:
    1.24              self.cursor.execute(*args, **kwargs)
    1.25 -        except MySQLdb.MySQLError:
    1.26 +        except mysqldb.MySQLError:
    1.27              self.ui.note(_('failed query: %s %s\n') % (args, kwargs))
    1.28              raise
    1.29  
    1.30 @@ -419,9 +419,9 @@
    1.31      bugzilla bug id. only add a comment once per bug, so same change
    1.32      seen multiple times does not fill bug with duplicate data.'''
    1.33      try:
    1.34 -        import MySQLdb as mysql
    1.35 -        global MySQLdb
    1.36 -        MySQLdb = mysql
    1.37 +        import mysqldb as mysql
    1.38 +        global mysqldb
    1.39 +        mysqldb = mysql
    1.40      except ImportError, err:
    1.41          raise util.Abort(_('python mysql support not available: %s') % err)
    1.42  
    1.43 @@ -436,6 +436,6 @@
    1.44              for id in ids:
    1.45                  bz.update(id, ctx)
    1.46              bz.notify(ids, util.email(ctx.user()))
    1.47 -    except MySQLdb.MySQLError, err:
    1.48 +    except mysqldb.MySQLError, err:
    1.49          raise util.Abort(_('database error: %s') % err[1])
    1.50  

Contact: Thomas Arendsen Hein <hg@intevation.org> - Intevation GmbH