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

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

Use --no-metadata so we don't get extra crap in the changelog.

  • Property svn:executable set to *
File size: 863 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',
11                           '--no-metadata', '%s/packages/%s' % (base, pkg)],
[1866]12                    stdout=subprocess.PIPE)
[1869]13   
14    # Then make the repository bare, because git-svn can't do this
15    shutil.move('%s/.git' % pkg, '%s.git' % pkg)
16    shutil.rmtree('%s' % pkg)
17    subprocess.check_call(['git', 'config', 'core.bare', 'true'], cwd='%s.git' % pkg)
[1866]18
19def cloneAllPackages(base):
20    for pkg in open('package-list'):
21        clonePackage(base, pkg.strip())
22
23if __name__ == '__main__':
24    try:
25        base = sys.argv[1]
26    except:
27        base = 'svn://invirt.mit.edu/trunk'
28   
29    cloneAllPackages(base)
Note: See TracBrowser for help on using the repository browser.