aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Harring <ferringb@google.com>2012-10-16 08:03:11 -0700
committerBrian Harring <ferringb@google.com>2012-10-16 13:28:49 -0700
commit2448ce179da8168bf4175d00f52c9c59e52f3880 (patch)
tree039f0ccfd68e0a308fcc7f93d01f3a40e348f2d9
parentabuse mmap to save on memory churn (diff)
downloadgit-conversion-tools-2448ce179da8168bf4175d00f52c9c59e52f3880.tar.gz
git-conversion-tools-2448ce179da8168bf4175d00f52c9c59e52f3880.tar.bz2
git-conversion-tools-2448ce179da8168bf4175d00f52c9c59e52f3880.zip
Minor bit of speedups; use sed instead of whacky python script, add time'ing for git fast import
-rwxr-xr-xcreate-git.sh2
-rwxr-xr-xprocess_directory.sh4
-rwxr-xr-xrewrite-blob-data.py17
3 files changed, 4 insertions, 19 deletions
diff --git a/create-git.sh b/create-git.sh
index 4fa47e5..79847b5 100755
--- a/create-git.sh
+++ b/create-git.sh
@@ -49,7 +49,7 @@ time {
"${root}/rewrite-commit-dump.py" | \
( read line; { echo "$line"; cat; } | \
tee ../export-stream-rewritten |\
- git fast-import
+ time git fast-import
)
} 2>&1 > >(tee git-creation.log)
ret=$?
diff --git a/process_directory.sh b/process_directory.sh
index 4918628..cb1041b 100755
--- a/process_directory.sh
+++ b/process_directory.sh
@@ -19,7 +19,9 @@ f() {
# Note we're only pull in blob data here; this intentional- we need to
# interlace the commit objects together, these git object pools will be
# be used as alternates for the final repo combination.
- "${base}/rewrite-blob-data.py" ../cvs2svn-tmp/git-blob.dat | \
+ sed -re \
+ 's|\$Header: '"$(readlink -f "$(pwd)")"'/*output/.*/cvs-repo/|$Header: /var/cvsroot/|g' \
+ ../cvs2svn-tmp/git-blob.dat | \
git fast-import --export-marks=../cvs2svn-tmp/git-blob.idx
rm -rf "${final}"
cd "$root"
diff --git a/rewrite-blob-data.py b/rewrite-blob-data.py
deleted file mode 100755
index 55115a7..0000000
--- a/rewrite-blob-data.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/python
-import functools
-import os
-import re
-import sys
-
-# $Header: /usr/local/ssd/gentoo-x86/output/.*/.*/cvs-repo/
-# $Header: /usr/local/ssd/gentoo-x86/output/app-accessibility/cvs-repo/gentoo-x86/app-accessibility/SphinxTrain/ChangeLog,v
-base = os.path.dirname(os.path.abspath(__file__))
-mangler = functools.partial(
- re.compile(r"\$Header: %s/output/.*/cvs-repo/" % base).sub,
- r"$Header: /var/cvsroot/")
-
-write = sys.stdout.write
-source = open(sys.argv[1]) if len(sys.argv) > 1 else sys.stdin
-for x in source:
- write(mangler(x))