Merge pull request #201 from kiwix/svn_export

Use faster svn export instead of svn checkout
This commit is contained in:
Matthieu Gautier 2018-07-16 11:45:38 +02:00 committed by GitHub
commit c4bd748d2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)