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