From: Barış Metin Date: Mon, 14 Jun 2010 14:28:09 +0000 (+0200) Subject: Repository.checkout() X-Git-Tag: 5.0-rc11~60 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b6fcf9462d319a79b3f696320d3db80f6f3bc244;p=build.git Repository.checkout() --- diff --git a/module-tools.py b/module-tools.py index ac4deb6c..c4ebf529 100755 --- a/module-tools.py +++ b/module-tools.py @@ -243,6 +243,17 @@ class Repository: return True return False + @classmethod + def checkout(cls, module, config, options, git=False): + target = "%s/%s" % (options.workdir) + + if git: + return GitRepository.checkout("%s:/git/%s.git" % (config['gitserver'], module), + target, options, depth=0) + else: + return SvnRepository.checkout("%s/%s" % (config['svnpath'], module), + target, options) + def __getattr__(self, attr): return getattr(self.repo, attr)