Use faster svn export instead of svn checkout

This commit is contained in:
Emmanuel Engelhart 2018-06-20 16:52:16 +02:00 committed by Matthieu Gautier
parent 87ef2b99f4
commit 79a08e001b
1 changed files with 3 additions and 8 deletions

View File

@ -175,19 +175,14 @@ class SvnClone(Source):
def svn_path(self): def svn_path(self):
return pj(neutralEnv('source_dir'), self.svn_dir) return pj(neutralEnv('source_dir'), self.svn_dir)
def _svn_checkout(self, context): def _svn_export(self, context):
if os.path.exists(self.svn_path): if os.path.exists(self.svn_path):
raise SkipCommand() raise SkipCommand()
command = "svn checkout {} {}".format(self.svn_remote, self.svn_dir) command = "svn export {} {}".format(self.svn_remote, self.svn_dir)
run_command(command, neutralEnv('source_dir'), context) run_command(command, neutralEnv('source_dir'), context)
def _svn_update(self, context):
context.try_skip(self.svn_path)
run_command("svn update", self.svn_path, context)
def prepare(self): def prepare(self):
self.command('svncheckout', self._svn_checkout) self.command('svnexport', self._svn_export)
self.command('svnupdate', self._svn_update)
if hasattr(self, 'patches'): if hasattr(self, 'patches'):
self.command('patch', self._patch) self.command('patch', self._patch)