Commit dec0949a authored by Yoshinori Okuji's avatar Yoshinori Okuji

use shutil.rmtree instead of removeAll.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17066 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 25fbccec
...@@ -37,7 +37,7 @@ from App.config import getConfiguration ...@@ -37,7 +37,7 @@ from App.config import getConfiguration
from Globals import package_home from Globals import package_home
from Products.ERP5 import product_path from Products.ERP5 import product_path
from Shared.DC.ZRDB.TM import TM from Shared.DC.ZRDB.TM import TM
from Products.ERP5.Document.BusinessTemplate import removeAll import shutil
from zLOG import LOG from zLOG import LOG
...@@ -51,7 +51,7 @@ class Deletion(TM): ...@@ -51,7 +51,7 @@ class Deletion(TM):
def _finish(self): def _finish(self):
try: try:
LOG('Deletion', 0, 'removing %s' % self.path) LOG('Deletion', 0, 'removing %s' % self.path)
removeAll(self.path) shutil.rmtree(self.path)
except OSError: except OSError:
pass pass
......
...@@ -36,7 +36,7 @@ from Globals import InitializeClass ...@@ -36,7 +36,7 @@ from Globals import InitializeClass
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.PythonScripts.Utility import allow_class from Products.PythonScripts.Utility import allow_class
from tempfile import mktemp from tempfile import mktemp
from Products.ERP5.Document.BusinessTemplate import removeAll import shutil
class SubversionError(Exception): class SubversionError(Exception):
"""The base exception class for the Subversion interface. """The base exception class for the Subversion interface.
...@@ -277,7 +277,7 @@ try: ...@@ -277,7 +277,7 @@ try:
"""Remove all files and folders in list """Remove all files and folders in list
""" """
for file_path in path_list: for file_path in path_list:
removeAll(file_path) shutil.rmtree(file_path)
def diff(self, path, revision1, revision2): def diff(self, path, revision1, revision2):
tmp = mktemp() tmp = mktemp()
......
...@@ -41,7 +41,7 @@ from cPickle import dumps, loads ...@@ -41,7 +41,7 @@ from cPickle import dumps, loads
from App.config import getConfiguration from App.config import getConfiguration
from tempfile import gettempdir, mktemp from tempfile import gettempdir, mktemp
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.ERP5.Document.BusinessTemplate import removeAll import shutil
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
from dircache import listdir from dircache import listdir
from OFS.Traversable import NotFound from OFS.Traversable import NotFound
...@@ -1058,7 +1058,7 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -1058,7 +1058,7 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
# Security hole fix # Security hole fix
raise SubversionSecurityError, 'You are not allowed to delete these files' raise SubversionSecurityError, 'You are not allowed to delete these files'
for file_path in path_list: for file_path in path_list:
removeAll(self._getWorkingPath(file_path)) shutil.rmtree(self._getWorkingPath(file_path))
def getModifiedTree(self, business_template, show_unmodified=False) : def getModifiedTree(self, business_template, show_unmodified=False) :
""" Return tree of files returned by svn status """ Return tree of files returned by svn status
...@@ -1139,7 +1139,7 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -1139,7 +1139,7 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
except (pysvn.ClientError, NotFound, AttributeError, \ except (pysvn.ClientError, NotFound, AttributeError, \
Error), error: Error), error:
# Clean up # Clean up
removeAll(path) shutil.rmtree(path)
raise error raise error
# Clean up # Clean up
self.activate().removeAllInList([path, ]) self.activate().removeAllInList([path, ])
......
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