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
...@@ -660,6 +660,15 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -660,6 +660,15 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
client.update(path) client.update(path)
# Import in zodb # Import in zodb
return self.importBT(bt) 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') security.declareProtected('Import/Export objects', 'switch')
def switch(self, bt, url): def switch(self, bt, url):
...@@ -941,6 +950,8 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -941,6 +950,8 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
return somethingModified and root return somethingModified and root
def extractBT(self, bt): def extractBT(self, bt):
# first update working copy
self.updatewc(bt)
bt.build() bt.build()
svn_path = self._getWorkingPath(self.getSubversionPath(bt) + os.sep) svn_path = self._getWorkingPath(self.getSubversionPath(bt) + os.sep)
path = mktemp() + os.sep path = mktemp() + os.sep
...@@ -954,8 +965,16 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -954,8 +965,16 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
self.activate().removeAllInList([path,]) self.activate().removeAllInList([path,])
def importBT(self, bt): 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 # Get a list of files and keep only parents
# Necessary before recursively commit removals # Necessary before recursively commit removals
def cleanChildrenInList(self, list): def cleanChildrenInList(self, list):
......
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