Commit 560ffcc0 authored by Christophe Dumez's avatar Christophe Dumez

- Improvements to support update bt from repository


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6925 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9bcc7e54
......@@ -253,8 +253,8 @@ try:
os.system('rm -rf %s'%tmp)
return diff
def revert(self, path):
return self.client.revert(path)
def revert(self, path, recurse=False):
return self.client.revert(path, recurse)
def log(self, path):
try:
......
......@@ -633,9 +633,12 @@ class SubversionTool(UniqueObject, Folder):
"""
path = self.getSubversionPath(bt)
client = self._getClient()
res = client.update(path)
self.importBT(bt);
return res
# Revert first to import a "pure" BT after update
self.revert(path=path, recurse=True)
# Update from SVN
client.update(path)
# Import in zodb
return self.importBT(bt);
security.declareProtected('Import/Export objects', 'add')
# path can be a list or not (relative or absolute)
......@@ -712,15 +715,16 @@ class SubversionTool(UniqueObject, Folder):
security.declareProtected('Import/Export objects', 'revert')
# path can be absolute or relative
def revert(self, path, bt):
def revert(self, path, bt=None, recurse=False):
"""Revert local changes in a file or a directory.
"""
client = self._getClient()
if bt:
if isinstance(path, list) :
path = [self.relativeToAbsolute(x, bt) for x in path]
else:
path = self.relativeToAbsolute(path, bt)
return client.revert(path)
return client.revert(path, recurse)
security.declareProtected('Import/Export objects', 'resolved')
# path can be absolute or relative
......@@ -852,7 +856,7 @@ class SubversionTool(UniqueObject, Folder):
self.activate().removeAllInList([path,])
def importBT(self, bt):
bt.download(self.getSubversionPath(bt))
return bt.download(self.getSubversionPath(bt))
# return a set with directories present in the directory
def getSetDirsForDir(self, directory):
......
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