projects
/
invirt/scripts/git-migration.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Quash the rest of the empty revisions.
[invirt/scripts/git-migration.git]
/
git-migrate
diff --git
a/git-migrate
b/git-migrate
index
c5886a9
..
52204b2
100755
(executable)
--- a/
git-migrate
+++ b/
git-migrate
@@
-29,21
+29,27
@@
def tagBase(pkg):
base],
cwd='%s.git' % pkg)
base],
cwd='%s.git' % pkg)
-def clonePackage(base, pkg):
- path = '%s/%s' % (base, pkg)
- pkg = os.path.basename(pkg)
+def clonePackage(base, repo_path):
+ pkg = os.path.basename(repo_path)
if not os.path.isdir('%s.git' % pkg):
if os.path.isdir(pkg):
shutil.rmtree(pkg)
if not os.path.isdir('%s.git' % pkg):
if os.path.isdir(pkg):
shutil.rmtree(pkg)
+
+ args = []
+ args.append('-Ttrunk/%s' % repo_path)
+ if repo_path.startswith('packages/'):
+ args.append('-tpackage_tags/%s' % pkg)
+ args.append(base)
+ args.append(pkg)
+
# Use --no-follow-parent because we're going to handle that with
# grafts.
subprocess.check_call(['git', 'svn', 'clone',
'--no-follow-parent',
'-Aauthors',
'-q',
# Use --no-follow-parent because we're going to handle that with
# grafts.
subprocess.check_call(['git', 'svn', 'clone',
'--no-follow-parent',
'-Aauthors',
'-q',
- '--no-metadata',
- '%s' % path],
+ '--no-metadata'] + args,
stdout=subprocess.PIPE)
# Then make the repository bare, because git-svn can't do this
stdout=subprocess.PIPE)
# Then make the repository bare, because git-svn can't do this
@@
-74,6
+80,8
@@
def clonePackage(base, pkg):
'--all'],
cwd='%s.git' % pkg)
'--all'],
cwd='%s.git' % pkg)
+ shutil.rmtree('%s.git/refs/original' % pkg, True)
+
tagBase(pkg)
def cloneAllPackages(base):
tagBase(pkg)
def cloneAllPackages(base):
@@
-168,7
+176,7
@@
if __name__ == '__main__':
try:
base = sys.argv[1]
except:
try:
base = sys.argv[1]
except:
- base = 'svn://invirt.mit.edu/trunk'
+ base = 'svn://invirt.mit.edu'
cloneAllPackages(base)
mergeHistories()
cloneAllPackages(base)
mergeHistories()