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
I'm not happy with the semantics of that first go at
[invirt/scripts/git-migration.git]
/
git-migrate
diff --git
a/git-migrate
b/git-migrate
index
b79053a
..
909a604
100755
(executable)
--- a/
git-migrate
+++ b/
git-migrate
@@
-32,7
+32,7
@@
def clonePackage(base, pkg):
stdout=subprocess.PIPE)
p.wait()
if len(p.stdout.read()) == 0:
stdout=subprocess.PIPE)
p.wait()
if len(p.stdout.read()) == 0:
- subprocess.check_call(['git', 'reset', 'HEAD^'],
+ subprocess.check_call(['git', 'reset', '--soft', 'HEAD^'],
cwd='%s.git' % pkg)
def cloneAllPackages(base):
cwd='%s.git' % pkg)
def cloneAllPackages(base):
@@
-44,16
+44,19
@@
def mergeHistory(old_pkg, new_pkg, n):
subprocess.check_call(['git', 'push',
'file:///%s/%s.git' % (cwd, new_pkg),
'master:refs/heads/%s' % old_pkg],
subprocess.check_call(['git', 'push',
'file:///%s/%s.git' % (cwd, new_pkg),
'master:refs/heads/%s' % old_pkg],
- cwd=new_pkg)
+ cwd='%s.git' % old_pkg)
def mergeHistories():
def mergeHistories():
- for line in open('grafts'):
+ merges = []
+ for line in open('merges'):
line = line.strip()
line = line.strip()
- if line[0] == '#' or line == '':
+ if line == '' or line[0] == '#':
continue
continue
- old_pkg, new_pkg, n = line.split()
- mergeHistory(old_pkg, new_pkg, int(n))
+ merges.append(line.split())
+
+ for merge in merges:
+ mergeHistory(*merge)
if __name__ == '__main__':
try:
if __name__ == '__main__':
try: