Remy Blank avatar Remy Blank committed 3b54556

0.11-stable: Added the new argument `log` to `init_db()` in all database connectors. This was missing in [8213].

Closes #8340.

Comments (0)

Files changed (4)

         their relative priorities as an iterable of `(scheme, priority)` tuples.
         """
 
-    def get_connection(**kwargs):
+    def get_connection(path, log=None, **kwargs):
         """Create a new connection to the database."""
         
-    def init_db(**kwargs):
+    def init_db(path, log=None, **kwargs):
         """Initialize the database."""
 
     def to_sql(table):

trac/db/mysql_backend.py

         return cnx
     
     def init_db(self, path, user=None, password=None, host=None, port=None,
-                params={}):
-        cnx = self.get_connection(path, user, password, host, port, params)
+                params={}, log=None):
+        cnx = self.get_connection(path, user, password, host, port, params,
+                                  log)
         cursor = cnx.cursor()
         from trac.db_default import schema
         for table in schema:

trac/db/postgres_backend.py

         return cnx
 
     def init_db(self, path, user=None, password=None, host=None, port=None,
-                params={}):
-        cnx = self.get_connection(path, user, password, host, port, params)
+                params={}, log=None):
+        cnx = self.get_connection(path, user, password, host, port, params,
+                                  log)
         cursor = cnx.cursor()
         if cnx.schema:
             cursor.execute('CREATE SCHEMA "%s"' % cnx.schema)

trac/db/sqlite_backend.py

                                         ('pysqlite', self._version)])
         return SQLiteConnection(path, params, log)
 
-    def init_db(cls, path, params={}):
+    def init_db(cls, path, params={}, log=None):
         if path != ':memory:':
             # make the directory to hold the database
             if os.path.exists(path):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.