Commit 26a1e753 authored by Christophe Dumez's avatar Christophe Dumez

- improved svn switch a little (canonicalize url)

- improved diff reponse speed thanks to activities


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7229 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fa73e352
......@@ -242,6 +242,12 @@ try:
# Since plain Python classes are not convenient in Zope, convert the objects.
return [Status(x) for x in self.client.status(path, **kw)]
def removeAllInList(self, list):
"""Remove all files and folders in list
"""
for file in list:
removeAll(file)
def diff(self, path, revision1, revision2):
tmp = mktemp()
os.makedirs(tmp)
......@@ -250,7 +256,7 @@ try:
else:
diff = self.client.diff(tmp_path=tmp, url_or_path=path, recurse=False, revision1=pysvn.Revision(pysvn.opt_revision_kind.number,revision1), revision2=pysvn.Revision(pysvn.opt_revision_kind.number,revision2))
# clean up temp dir
removeAll(tmp)
self.activate().removeAllInList([tmp,])
return diff
def revert(self, path, recurse=False):
......
......@@ -633,8 +633,10 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
"""
path = self.getSubversionPath(bt)
client = self._getClient()
if url[-1] == '/' :
url = url[:-1]
# Update from SVN
client.switch(path, url)
client.switch(path=path, url=url)
security.declareProtected('Import/Export objects', 'add')
# path can be a list or not (relative or absolute)
......
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