From: Evan Broder Date: Thu, 25 Dec 2008 04:33:25 +0000 (-0500) Subject: I'm not happy with the semantics of that first go at X-Git-Url: http://xvm.mit.edu/gitweb/invirt/scripts/git-migration.git/commitdiff_plain/492d83fe61f1afa3a14345414b38e6f13b42e6a6 I'm not happy with the semantics of that first go at mergeHistory. Let's try again svn path=/trunk/scripts/git-migration/; revision=1890 --- diff --git a/git-migrate b/git-migrate index 65c7a12..909a604 100755 --- a/git-migrate +++ b/git-migrate @@ -44,41 +44,7 @@ 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], - cwd='%s.git' % new_pkg) - - graft = [] - p = subprocess.Popen(['git', 'rev-list', - '--reverse', - '--skip=%s' % n, - 'master'], - cwd='%s.git' % new_pkg, - stdout=subprocess.PIPE) - p.wait() - new_rev = p.stdout.read().split()[0] - graft.append(new_rev) - - # If n isn't 0, then n has a parent commit already that we - # shouldn't forget about. - if n != 0: - p = subprocess.Popen(['git', 'rev-parse', - '%s^' % new_rev], - cwd='%s.git' % new_pkg, - stdout=subprocess.PIPE) - p.wait() - graft.append(p.stdout.read().strip()) - - # And regardless, the HEAD of old_pkg should be a parent of - # new_pkg - p = subprocess.Popen(['git', 'rev-parse', - 'master'], - cwd='%s.git' % old_pkg, - stdout=subprocess.PIPE) - p.wait() - graft.append(p.stdout.read().strip()) - - f = open('%s.git/info/grafts' % new_pkg, 'a') - - print >>f, ' '.join(graft) + cwd='%s.git' % old_pkg) def mergeHistories(): merges = [] @@ -91,16 +57,6 @@ def mergeHistories(): for merge in merges: mergeHistory(*merge) - - for line in open('package-list'): - line = line.strip() - subprocess.check_call(['git', 'filter-branch', - '--', - '--all'], - cwd='%s.git' % line) - - for merge in merges: - shutil.rmtree('%s.git' % merge[0]) if __name__ == '__main__': try: