X-Git-Url: http://xvm.mit.edu/gitweb/invirt/scripts/git-migration.git/blobdiff_plain/f042480e435cbf19bac8bb6ae0d4a16ba57e517f..43c6c3d1d9ae3039203808aefd8411592bab9cc0:/git-migrate diff --git a/git-migrate b/git-migrate index f03884f..053c9a9 100755 --- a/git-migrate +++ b/git-migrate @@ -29,6 +29,9 @@ def tagBase(pkg): cwd='%s.git' % pkg) def clonePackage(base, pkg): + path = '%s/%s' % (base, pkg) + pkg = os.path.basename(pkg) + if not os.path.isdir('%s.git' % pkg): if os.path.isdir(pkg): shutil.rmtree(pkg) @@ -39,7 +42,7 @@ def clonePackage(base, pkg): '-Aauthors', '-q', '--no-metadata', - '%s/packages/%s' % (base, pkg)], + '%s' % path], stdout=subprocess.PIPE) # Then make the repository bare, because git-svn can't do this @@ -118,6 +121,12 @@ def mergeHistory(old_pkg, new_pkg, n): '--', '--all'], cwd='%s.git' % new_pkg) + + subprocess.call(['git', 'branch', + '-D', + old_pkg], + cwd='%s.git' % new_pkg) + shutil.rmtree('%s.git/refs/original' % new_pkg, True) def mergeHistories(): merges = [] @@ -130,6 +139,9 @@ def mergeHistories(): for merge in merges: mergeHistory(*merge) + + for merge in merges: + shutil.rmtree('%s.git' % merge[0]) if __name__ == '__main__': try: