[Erp5-report] r39132 leonardo - in /erp5/trunk/products/ERP5Subversion: ./ Tool/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 14 14:15:24 CEST 2010


Author: leonardo
Date: Thu Oct 14 14:15:20 2010
New Revision: 39132

URL: http://svn.erp5.org?rev=39132&view=rev
Log:
allow capturing the error raised by a business template that is not in any svn working copy and add an API to allow its creation in a configured repository

Modified:
    erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py
    erp5/trunk/products/ERP5Subversion/__init__.py

Modified: erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py?rev=39132&r1=39131&r2=39132&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Subversion/Tool/SubversionTool.py [utf8] Thu Oct 14 14:15:20 2010
@@ -397,6 +397,20 @@ class SubversionTool(BaseTool):
     # Get the svn client object.
     return newSubversionClient(self, **kw)
   
+  security.declareProtected('Import/Export objects', 'createSubversionPath')
+  def createSubversionPath(self, working_copy, business_template):
+    """
+     create the working copy path corresponding to the given business
+     template, checking it is in the working copy list in preferences
+    """
+    bt_name = business_template.getTitle()
+    assert bt_name == os.path.basename(bt_name), 'Invalid bt_name'
+    working_copy = self._getWorkingPath(working_copy)
+    wc_path = os.path.join(working_copy, bt_name)
+    os.mkdir(wc_path)
+    client = self._getClient()
+    client.add([wc_path])
+
   security.declareProtected('Import/Export objects', 'getSubversionPath')
   def getSubversionPath(self, business_template, with_name=True):
     """

Modified: erp5/trunk/products/ERP5Subversion/__init__.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Subversion/__init__.py?rev=39132&r1=39131&r2=39132&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Subversion/__init__.py [utf8] (original)
+++ erp5/trunk/products/ERP5Subversion/__init__.py [utf8] Thu Oct 14 14:15:20 2010
@@ -55,7 +55,9 @@ def initialize( context ):
                          content_classes = content_classes)
 
 from AccessControl.SecurityInfo import allow_module
+from AccessControl.SecurityInfo import ModuleSecurityInfo
 
 allow_module('Products.ERP5Subversion.SubversionClient')
+ModuleSecurityInfo('Products.ERP5Subversion.Tool.SubversionTool').declarePublic('SubversionUnknownBusinessTemplateError')
 
 




More information about the Erp5-report mailing list