merge with crew.
authorVadim Gelfer <vadim.gelfer@gmail.com>
Mon, 08 May 2006 08:04:46 -0700
changeset 2219 ec82cff7d2c4
parent 2218 afe24f5b7a9e (diff)
parent 2217 f72c438ce08c (current diff)
child 2220 6d3cc2a982f3
merge with crew.
hgext/bugzilla.py
tests/run-tests
--- a/hgext/bugzilla.py	Sat May 06 16:43:16 2006 +0200
+++ b/hgext/bugzilla.py	Mon May 08 08:04:46 2006 -0700
@@ -45,10 +45,7 @@
 from mercurial.node import *
 demandload(globals(), 'mercurial:templater,util os re time')
 
-try:
-    import MySQLdb
-except ImportError:
-    raise util.Abort(_('python mysql support not available'))
+MySQLdb = None
 
 def buglist(ids):
     return '(' + ','.join(map(str, ids)) + ')'
@@ -262,6 +259,13 @@
     '''add comment to bugzilla for each changeset that refers to a
     bugzilla bug id. only add a comment once per bug, so same change
     seen multiple times does not fill bug with duplicate data.'''
+    try:
+        import MySQLdb as mysql
+        global MySQLdb
+        MySQLdb = mysql
+    except ImportError, err:
+        raise util.Abort(_('python mysql support not available: %s') % err)
+
     if node is None:
         raise util.Abort(_('hook type %s does not pass a changeset id') %
                          hooktype)