Commit a071bd04 authored by Rafael Monnerat's avatar Rafael Monnerat

Added support to svn checkout.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33072 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3d6e1491
...@@ -318,7 +318,10 @@ try: ...@@ -318,7 +318,10 @@ try:
def switch(self, path, url): def switch(self, path, url):
return self.client.switch(path=path, url=url) return self.client.switch(path=path, url=url)
def checkout(self, path, url):
return self.client.checkout(path=path, url=url)
def log(self, path): def log(self, path):
try: try:
log_list = self.client.log(path) log_list = self.client.log(path)
......
...@@ -516,7 +516,26 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -516,7 +516,26 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
url = url[:-1] url = url[:-1]
# Update from SVN # Update from SVN
client.switch(path=path, url=url) client.switch(path=path, url=url)
security.declareProtected('Import/Export objects', 'checkout')
def checkout(self, business_template, url):
""" Checkout business configuration from SVN into
the first Preferres Subversion Working Copy.
"""
wc_list = self.getPortalObject().portal_preferences\
.getPreferredSubversionWorkingCopyList()
if not wc_list or len(wc_list) == 0 :
raise SubversionPreferencesError, \
'Please set at least one Subversion Working Copy in preferences first.'
bt_name = business_template.getTitle()
wc_path = os.path.join(wc_list[0], bt_name)
path = self._getWorkingPath(wc_path)
client = self._getClient()
if url[-1] != '/' :
url += '/'
url += bt_name
client.checkout(path=path, url=url)
security.declareProtected('Import/Export objects', 'add') security.declareProtected('Import/Export objects', 'add')
# path can be a list or not (relative or absolute) # path can be a list or not (relative or absolute)
def add(self, path, business_template=None): def add(self, path, business_template=None):
......
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