allow capturing the error raised by a business template that is not in any svn...

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

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39132 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent df818e00
......@@ -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):
"""
......
......@@ -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')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment