So apparently I was working on a patch before I packed up to move, and I
  would like it if someone else could glance at this to be sure I didn't
miss something massive. The patch is to make sure plugins defined in any
  inherited config files at initenv (via --inherit) will be loaded
during environment creation. If they aren't their environment setup
callbacks will never get run.

--Noah

Index: trac/env.py
===================================================================
--- trac/env.py (revision 7075)
+++ trac/env.py (working copy)
@@ -180,14 +180,11 @@
             ]
         self._href = self._abs_href = None
 
-        from trac.loader import load_components
-        plugins_dir = self.config.get('inherit', 'plugins_dir')
-        load_components(self, plugins_dir and (plugins_dir,))
-
         if create:
             self.create(options)
         else:
             self.verify()
+            self.setup_plugins()
 
         if create:
             for setup_participant in self.setup_participants:
@@ -300,7 +297,10 @@
             self.config.set(section, name, value)
         self.config.save()
         self.config.parse_if_needed() # Full reload to get 'inherit' working
-
+        
+        # Try loading plugins
+        self.setup_plugins()
+        
         # Create the database
         DatabaseManager(self).init_db()
 
@@ -333,6 +333,12 @@
                         value = None
                     self.config.set(section, name, value)
 
+    def setup_plugins(self):
+        """Try to load plugins."""
+        from trac.loader import load_components
+        plugins_dir = self.config.get('inherit', 'plugins_dir')
+        load_components(self, plugins_dir and (plugins_dir,))
+
     def get_templates_dir(self):
         """Return absolute path to the templates directory."""
         return os.path.join(self.path, 'templates')

Attachment: signature.asc
Description: PGP signature

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to