| 
                Last change
                  on this file since 1869 was
                  1869,
                  checked in by broder, 17 years ago
           | 
        
        
          | 
               
Make the git checkout a bare repo, because git-svn won't do that. 
 
           | 
        
        
          
            
              - 
                  Property svn:executable set to
                  
*
               
             
           | 
        
        | 
            File size:
            819 bytes
           | 
      
      
        
  | Rev | Line |   | 
|---|
| [1866] | 1 | #!/usr/bin/python | 
|---|
 | 2 |  | 
|---|
 | 3 | import sys | 
|---|
 | 4 | import subprocess | 
|---|
| [1869] | 5 | import shutil | 
|---|
| [1866] | 6 |  | 
|---|
 | 7 | def clonePackage(base, pkg): | 
|---|
 | 8 |     # Use --no-follow-parent because we're going to handle that with | 
|---|
 | 9 |     # grafts. | 
|---|
| [1868] | 10 |     subprocess.check_call(['git', 'svn', 'clone', '--no-follow-parent', '%s/packages/%s' % (base, pkg)], | 
|---|
| [1866] | 11 |                     stdout=subprocess.PIPE) | 
|---|
| [1869] | 12 |      | 
|---|
 | 13 |     # Then make the repository bare, because git-svn can't do this | 
|---|
 | 14 |     shutil.move('%s/.git' % pkg, '%s.git' % pkg) | 
|---|
 | 15 |     shutil.rmtree('%s' % pkg) | 
|---|
 | 16 |     subprocess.check_call(['git', 'config', 'core.bare', 'true'], cwd='%s.git' % pkg) | 
|---|
| [1866] | 17 |  | 
|---|
 | 18 | def cloneAllPackages(base): | 
|---|
 | 19 |     for pkg in open('package-list'): | 
|---|
 | 20 |         clonePackage(base, pkg.strip()) | 
|---|
 | 21 |  | 
|---|
 | 22 | if __name__ == '__main__': | 
|---|
 | 23 |     try: | 
|---|
 | 24 |         base = sys.argv[1] | 
|---|
 | 25 |     except: | 
|---|
 | 26 |         base = 'svn://invirt.mit.edu/trunk' | 
|---|
 | 27 |      | 
|---|
 | 28 |     cloneAllPackages(base) | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.