Commit 5077ae30 authored by Christophe Dumez's avatar Christophe Dumez

- buid business template automatically to get latest changes

- revert is now partially working (added files can't be reverted yet) 


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6993 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 412a4acb
...@@ -727,20 +727,28 @@ class SubversionTool(UniqueObject, Folder): ...@@ -727,20 +727,28 @@ class SubversionTool(UniqueObject, Folder):
if 'bt' not in path_list: if 'bt' not in path_list:
if len(path_list) > 2 : if len(path_list) > 2 :
tmp=os.sep.join(path_list[2:]) tmp=os.sep.join(path_list[2:])
tmp2 = re.search('\\.[\w]+$', tmp)
if tmp2:
extension = tmp2.string[tmp2.start():tmp2.end()].strip()
tmp = tmp.replace(extension, '')
object_to_update[tmp] = 'install' object_to_update[tmp] = 'install'
#raise str(object_to_update)
path = [self.relativeToAbsolute(x, bt) for x in path] path = [self.relativeToAbsolute(x, bt) for x in path]
else: else:
path_list = path.split(os.sep) path_list = path.split(os.sep)
if 'bt' not in path_list: if 'bt' not in path_list:
if len(path_list) > 2 : if len(path_list) > 2 :
tmp=os.sep.join(path_list[2:]) tmp=os.sep.join(path_list[2:])
tmp2 = re.search('\\.[\w]+$', tmp)
if tmp2:
extension = tmp2.string[tmp2.start():tmp2.end()].strip()
tmp = tmp.replace(extension, '')
object_to_update[tmp] = 'install' object_to_update[tmp] = 'install'
path = self.relativeToAbsolute(path, bt) path = self.relativeToAbsolute(path, bt)
client.revert(path, recurse) client.revert(path, recurse)
if bt is not None: if bt is not None:
installed_bt = bt.portal_templates.getInstalledBusinessTemplate( bt.getTitle()) installed_bt = bt.portal_templates.getInstalledBusinessTemplate( bt.getTitle())
installed_bt.install(object_to_update=object_to_update, force=0) installed_bt.reinstall(object_to_update=object_to_update, force=0)
bt.build()
security.declareProtected('Import/Export objects', 'resolved') security.declareProtected('Import/Export objects', 'resolved')
# path can be absolute or relative # path can be absolute or relative
...@@ -860,6 +868,7 @@ class SubversionTool(UniqueObject, Folder): ...@@ -860,6 +868,7 @@ class SubversionTool(UniqueObject, Folder):
return somethingModified and root return somethingModified and root
def extractBT(self, bt): def extractBT(self, bt):
bt.build()
svn_path = self.getSubversionPath(bt) + os.sep svn_path = self.getSubversionPath(bt) + os.sep
path = mktemp() +os.sep path = mktemp() +os.sep
bt.export(path=path, local=1) bt.export(path=path, local=1)
......
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