Commit b118d3a4 authored by Christophe Dumez's avatar Christophe Dumez

- update local working copy when clicking on subversion tab.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7326 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca902a87
......@@ -661,6 +661,15 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
# Import in zodb
return self.importBT(bt)
security.declareProtected('Import/Export objects', 'updatewc')
def updatewc(self, bt):
"""Update a working copy.
"""
path = self._getWorkingPath(self.getSubversionPath(bt))
client = self._getClient()
# Update from SVN
client.update(path)
security.declareProtected('Import/Export objects', 'switch')
def switch(self, bt, url):
"""switch SVN repository for a working copy.
......@@ -941,6 +950,8 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
return somethingModified and root
def extractBT(self, bt):
# first update working copy
self.updatewc(bt)
bt.build()
svn_path = self._getWorkingPath(self.getSubversionPath(bt) + os.sep)
path = mktemp() + os.sep
......@@ -954,7 +965,15 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
self.activate().removeAllInList([path,])
def importBT(self, bt):
return bt.download(self._getWorkingPath(self.getSubversionPath(bt)))
# Do svn export before importing to get rid of .svn stuff
# and unversioned files.
tmp_path = mktemp() + os.sep
self.export(self._getWorkingPath(self.getSubversionPath(bt)), tmp_path)
# Import
id = bt.download(tmp_path)
# Clean up
self.activate().removeAllInList([tmp_path,])
return id
# Get a list of files and keep only parents
# Necessary before recursively commit removals
......
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