diff options
author | Brian Harring <ferringb@google.com> | 2012-10-14 15:56:29 -0700 |
---|---|---|
committer | Brian Harring <ferringb@google.com> | 2012-10-16 13:28:49 -0700 |
commit | 901721097cd3cf4a7c23a0e1d15767f5defe727a (patch) | |
tree | 1bdb14a1cfff83b949ff481885cd25f620d692c5 | |
parent | Ongoing mangling (diff) | |
download | git-conversion-tools-901721097cd3cf4a7c23a0e1d15767f5defe727a.tar.gz git-conversion-tools-901721097cd3cf4a7c23a0e1d15767f5defe727a.tar.bz2 git-conversion-tools-901721097cd3cf4a7c23a0e1d15767f5defe727a.zip |
update gitignore for intermediate/resultant content
-rw-r--r-- | .gitignore | 11 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | config | 17 | ||||
-rwxr-xr-x | create-mailmap.py | 26 | ||||
-rwxr-xr-x | process_directory.sh | 2 | ||||
-rwxr-xr-x | script.sh | 1 |
6 files changed, 45 insertions, 14 deletions
@@ -1,3 +1,8 @@ -cvs-repo -output -final +/cvs-repo +/output +/final +/git +/export-stream-raw +/export-stream-rewritten +/userinfo.xml +/gentoo_mailmap.py @@ -7,6 +7,8 @@ that said, it needs to conform to thus: $(pwd)/cvs-repo/CVSROOT $(pwd)/cvs-repo/gentoo-x86/* +From there, get yourself a userinfo.xml, and place it into $(pwd). + From there, ./script.sh is your main point of entry; it'll process that, going parallel, using $(pwd)/output for temp space- it's suggested that be tmpfs (much like cvs-repo). @@ -481,17 +481,12 @@ ctx.retain_conflicting_attic_files = False # with "u" as a prefix) or 8-bit strings in the utf-8 encoding. # Please substitute your own project's usernames here to use with the # author_transforms option of GitOutputOption below. -author_transforms={ - 'jrandom' : ('J. Random', 'jrandom@example.com'), - 'mhagger' : ('Michael Haggerty', 'mhagger@alum.mit.edu'), - 'brane' : (u'Branko Čibej', 'brane@xbc.nu'), - 'ringstrom' : ('Tobias Ringström', 'tobias@ringstrom.mine.nu'), - 'dionisos' : (u'Erik Hülsmann', 'e.huelsmann@gmx.net'), - - # This one will be used for commits for which CVS doesn't record - # the original author, as explained above. - 'cvs2svn' : ('cvs2svn', 'admin@example.com'), - } + +import gentoo_mailmap +author_transforms = gentoo_mailmap.mailmap.copy() +# This one will be used for commits for which CVS doesn't record +# the original author, as explained above. +author_transforms['cvs2svn'] = ('cvs2svn', 'admin@gentoo.org') # This is the main option that causes cvs2svn to output to a # "fastimport"-format dumpfile rather than to Subversion: diff --git a/create-mailmap.py b/create-mailmap.py new file mode 100755 index 0000000..085d84f --- /dev/null +++ b/create-mailmap.py @@ -0,0 +1,26 @@ +#!/usr/bin/python +from xml.etree import ElementTree as etree + +def main(source): + root = etree.parse(source).getroot() + for user in root.findall('user'): + fullname = user.findall('realname')[0].get('fullname') + # Compute email ourselves... + username = user.get('username') + assert username + email = '%s@gentoo.org' % username + yield username, (fullname, email) + # Handle aliases... + for alias in user.findall('alias'): + yield alias.text, (fullname, email) + + +if __name__ == '__main__': + import sys + if len(sys.argv) != 2: + sys.stderr.write("path to userinfo.xml required\n") + sys.exit(1) + + mailmap = dict(main(open(sys.argv[1], 'rb'))) + sys.stdout.write("mailmap=%r\n" % (mailmap,)) + sys.exit(0) diff --git a/process_directory.sh b/process_directory.sh index c9ff6e6..14ef28c 100755 --- a/process_directory.sh +++ b/process_directory.sh @@ -9,8 +9,10 @@ f() { ln -s "${root}/gentoo-x86/$1" "${output}/cvs-repo/gentoo-x86/$1" #ln -s "${root}/gentoo-x86/Attic" "${output}/cvs-repo/gentoo-x86/Attic" ln -s "$(pwd)/config" "${output}/config" + ln -s "$(pwd)/gentoo_mailmap.py" "${output}/gentoo_mailmap.py" # Note- this must be canonical path, else it screws up our $Header rewriting. cd "$(readlink -f "${output}" )" + export PYTHONPATH="${output}${PYTHONPATH:+:${PYTHONPATH}}" time cvs2git --options config -vv cd git git init --bare @@ -5,6 +5,7 @@ proc_count=$(grep -c MHz /proc/cpuinfo) rm -rf git/* git/.git final/* mkdir git -p +./create-mailmap.py userinfo.xml > gentoo_mailmap.py || { echo "failed to create mailmap."; exit 1; } # Prioritize the larger categories first; they typically will have # the most revs, thus start them first. time { \ |