source: trunk/scripts/git-migration/git-migrate @ 1873

Last change on this file since 1873 was 1873, checked in by broder, 16 years ago

Make git-svn a little less noisy.

  • Property svn:executable set to *
File size: 936 bytes
RevLine 
[1866]1#!/usr/bin/python
2
3import sys
4import subprocess
[1869]5import shutil
[1866]6
7def clonePackage(base, pkg):
8    # Use --no-follow-parent because we're going to handle that with
9    # grafts.
[1870]10    subprocess.check_call(['git', 'svn', 'clone', '--no-follow-parent',
[1871]11                           '-Aauthors',
[1873]12                           '-q',
[1870]13                           '--no-metadata', '%s/packages/%s' % (base, pkg)],
[1866]14                    stdout=subprocess.PIPE)
[1869]15   
16    # Then make the repository bare, because git-svn can't do this
17    shutil.move('%s/.git' % pkg, '%s.git' % pkg)
18    shutil.rmtree('%s' % pkg)
19    subprocess.check_call(['git', 'config', 'core.bare', 'true'], cwd='%s.git' % pkg)
[1866]20
21def cloneAllPackages(base):
22    for pkg in open('package-list'):
23        clonePackage(base, pkg.strip())
24
25if __name__ == '__main__':
26    try:
27        base = sys.argv[1]
28    except:
29        base = 'svn://invirt.mit.edu/trunk'
30   
31    cloneAllPackages(base)
Note: See TracBrowser for help on using the repository browser.