# HG changeset patch # User Jeff Hammel # Date 1306790542 25200 # Node ID 425a3c73ac1d749fd92eb4740a38b4fe4b2db4aa # Parent 1378e96c65acbdcab5347cdf27e0879d31c7fcb6 add a convenience method for VCS sources diff -r 1378e96c65ac -r 425a3c73ac1d buttercup/source.py --- a/buttercup/source.py Mon May 30 14:06:29 2011 -0700 +++ b/buttercup/source.py Mon May 30 14:22:22 2011 -0700 @@ -57,3 +57,16 @@ # TODO: add a more intelligent .git/config __call__ = update + +def VCS_sources(source_dict, **kwargs): + retval = [] + for repo_type, sources in source_dict.items(): + if repo_type == 'hg': + retval.extend([HgSource(source, **kwargs) + for source in sources]) + elif repo_type == 'git': + retval.extend([GitSource(source, **kwargs) + for source in sources]) + else: + raise AssertionError("Source type unknown: %s" % repo_type) + return retval