Commit a00de625 authored by Christophe Dumez's avatar Christophe Dumez

- Added some missing callbacks

- Don't ask server about about of datedness anymore (takes to much time and crash sometimes...)
- Raise an exception when reverting changes for a business template that is not installed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8653 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b20c8f74
...@@ -128,6 +128,18 @@ try: ...@@ -128,6 +128,18 @@ try:
# 0x8 means that the CA is unknown. # 0x8 means that the CA is unknown.
return True, 0x8, permanent return True, 0x8, permanent
class SSLServerPromptCallback(Callback):
def __call__(self):
return
class SSLClientCertPromptCallback(Callback):
def __call__(self):
return
class SSLClientCertPasswordPromptCallback(Callback):
def __call__(self):
return
# Wrap objects defined in pysvn so that skins # Wrap objects defined in pysvn so that skins
# have access to attributes in the ERP5 way. # have access to attributes in the ERP5 way.
class Getter(Method): class Getter(Method):
...@@ -192,12 +204,16 @@ try: ...@@ -192,12 +204,16 @@ try:
self.client = pysvn.Client() self.client = pysvn.Client()
self.client.set_auth_cache(0) self.client.set_auth_cache(0)
obj = self.__of__(container) obj = self.__of__(container)
self.client.exception_style = 1
self.client.callback_cancel = CancelCallback(obj) self.client.callback_cancel = CancelCallback(obj)
self.client.callback_get_log_message = GetLogMessageCallback(obj) self.client.callback_get_log_message = GetLogMessageCallback(obj)
self.client.callback_get_login = GetLoginCallback(obj) self.client.callback_get_login = GetLoginCallback(obj)
self.client.callback_notify = NotifyCallback(obj) self.client.callback_notify = NotifyCallback(obj)
self.client.callback_ssl_server_trust_prompt = \ self.client.callback_ssl_server_trust_prompt = \
SSLServerTrustPromptCallback(obj) SSLServerTrustPromptCallback(obj)
self.client.callback_ssl_server_prompt = SSLServerPromptCallback(obj)
self.client.callback_ssl_client_cert_prompt = SSLClientCertPromptCallback(obj)
self.client.callback_ssl_client_cert_password_prompt = SSLClientCertPasswordPromptCallback(obj)
self.creation_time = time.time() self.creation_time = time.time()
self.__dict__.update(**kw) self.__dict__.update(**kw)
self.exception = None self.exception = None
......
...@@ -134,6 +134,11 @@ class SubversionNotAWorkingCopyError(Exception): ...@@ -134,6 +134,11 @@ class SubversionNotAWorkingCopyError(Exception):
""" """
pass pass
class SubversionBusinessTemplateNotInstalled(Exception):
""" Exception called when the business template is not installed
"""
pass
class UnauthorizedAccessToPath(Exception): class UnauthorizedAccessToPath(Exception):
""" When path is not in zope home instance """ When path is not in zope home instance
""" """
...@@ -915,6 +920,8 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -915,6 +920,8 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
# Partially reinstall installed bt # Partially reinstall installed bt
installed_bt = business_template.portal_templates\ installed_bt = business_template.portal_templates\
.getInstalledBusinessTemplate(business_template.getTitle()) .getInstalledBusinessTemplate(business_template.getTitle())
if installed_bt is None:
raise SubversionBusinessTemplateNotInstalled, "Revert won't work if the business template is not installed. Please install it first."
installed_bt.reinstall(object_to_update=object_to_update, force=0) installed_bt.reinstall(object_to_update=object_to_update, force=0)
security.declareProtected('Import/Export objects', 'resolved') security.declareProtected('Import/Export objects', 'resolved')
...@@ -1033,8 +1040,9 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -1033,8 +1040,9 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
# Business template root directory is the root of the tree # Business template root directory is the root of the tree
root = Dir(business_template.getTitle(), "normal") root = Dir(business_template.getTitle(), "normal")
something_modified = False something_modified = False
statusObj_list = self.status(os.path.join(bt_path, \ statusObj_list = self.status(os.path.join(bt_path, \
business_template.getTitle()), update=True) business_template.getTitle()), update=False)
# We browse the files returned by svn status # We browse the files returned by svn status
for status_obj in statusObj_list : for status_obj in statusObj_list :
# can be (normal, added, modified, deleted, conflicted, unversioned) # can be (normal, added, modified, deleted, conflicted, unversioned)
......
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