comparison buttercup/source.py @ 23:425a3c73ac1d

add a convenience method for VCS sources
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 30 May 2011 14:22:22 -0700
parents 1378e96c65ac
children a54543838686
comparison
equal deleted inserted replaced
22:1378e96c65ac 23:425a3c73ac1d
55 os.makedirs(self.srcdir) 55 os.makedirs(self.srcdir)
56 call(['git', 'clone', self.uri], cwd=self.srcdir) 56 call(['git', 'clone', self.uri], cwd=self.srcdir)
57 # TODO: add a more intelligent .git/config 57 # TODO: add a more intelligent .git/config
58 58
59 __call__ = update 59 __call__ = update
60
61 def VCS_sources(source_dict, **kwargs):
62 retval = []
63 for repo_type, sources in source_dict.items():
64 if repo_type == 'hg':
65 retval.extend([HgSource(source, **kwargs)
66 for source in sources])
67 elif repo_type == 'git':
68 retval.extend([GitSource(source, **kwargs)
69 for source in sources])
70 else:
71 raise AssertionError("Source type unknown: %s" % repo_type)
72 return retval