8 def clonePackage(base, pkg):
9 if not os.path.isdir('%s.git' % pkg):
10 if os.path.isdir(pkg):
12 # Use --no-follow-parent because we're going to handle that with
14 subprocess.check_call(['git', 'svn', 'clone', '--no-follow-parent',
17 '--no-metadata', '%s/packages/%s' % (base, pkg)],
18 stdout=subprocess.PIPE)
20 # Then make the repository bare, because git-svn can't do this
21 shutil.move('%s/.git' % pkg, '%s.git' % pkg)
22 shutil.rmtree('%s' % pkg)
23 subprocess.check_call(['git', 'config', 'core.bare', 'true'], cwd='%s.git' % pkg)
25 def cloneAllPackages(base):
26 for pkg in open('package-list'):
27 clonePackage(base, pkg.strip())
29 if __name__ == '__main__':
33 base = 'svn://invirt.mit.edu/trunk'
35 cloneAllPackages(base)