Commits

Olemis Lang committed 8db020f Merge

BH Multiproduct #355 : Merge 7fdcdd2f504b9803455ef50e incorporating new way to handle product_config_parent option

  • Participants
  • Parent commits 7fdcdd2, 55544c7
  • Branches t355_trac_test_suite

Comments (0)

Files changed (1)

t115/t115_r1437383_inherit_product_config.diff

 
 diff -r 6d8eb9a53b0f bloodhound_multiproduct/multiproduct/api.py
 --- a/bloodhound_multiproduct/multiproduct/api.py	Wed Jan 23 13:24:12 2013 +0000
-+++ b/bloodhound_multiproduct/multiproduct/api.py	Wed Jan 23 22:39:23 2013 -0500
++++ b/bloodhound_multiproduct/multiproduct/api.py	Wed Jan 23 23:19:57 2013 -0500
 @@ -22,6 +22,7 @@
  from genshi.builder import tag
  
              IPermissionRequestor, ITicketFieldProvider, IResourceManager)
 -    
 +
-+    product_config_parent = PathOption('inherit', 'multiproduct', 'trac.ini',
++    product_config_parent = PathOption('inherit', 'multiproduct', '',
 +        """The path to the configuration file containing the settings shared
-+        by sibling product environments. By default it will be the path to
-+        the configuration file of the global environment (i.e. trac.ini).
++        by sibling product environments. By default will inherit 
++        global environment configuration.
 +        """)
 +
      SCHEMA = [mcls._get_schema() \
          return []
 diff -r 6d8eb9a53b0f bloodhound_multiproduct/multiproduct/env.py
 --- a/bloodhound_multiproduct/multiproduct/env.py	Wed Jan 23 13:24:12 2013 +0000
-+++ b/bloodhound_multiproduct/multiproduct/env.py	Wed Jan 23 22:39:23 2013 -0500
++++ b/bloodhound_multiproduct/multiproduct/env.py	Wed Jan 23 23:19:57 2013 -0500
 @@ -29,6 +29,7 @@
  from trac.versioncontrol import RepositoryManager
  from trac.web.href import Href
  from multiproduct.config import Configuration
  from multiproduct.model import Product
  from multiproduct.dbcursor import BloodhoundIterableCursor
-@@ -451,8 +452,12 @@
+@@ -451,8 +452,14 @@
      def setup_config(self):
          """Load the configuration object.
          """
 -        # FIXME: Inherit global environment setting ?
 -        self.config = Configuration(self.parent, self.product.prefix)
-+        parent = MultiProductSystem(self.parent).product_config_parent
-+        if parent and os.path.isfile(parent):
-+            parents = [parent]
++        import trac.config
++
++        parent_path = MultiProductSystem(self.parent).product_config_parent
++        if parent_path and os.path.isfile(parent_path):
++            parents = [trac.config.Configuration(parent_path)]
 +        else:
-+            parents = None
++            parents = [self.parent.config]
 +        self.config = Configuration(self.parent, self.product.prefix, parents)
          self.setup_log()