# HG changeset patch # User Chris Cannam # Date 1432048474 -3600 # Node ID e2a3230f61fae577cef332918b18d04b7181f7a1 # Parent e2c122809c5c5d28a7895d4c9eb82e4b57808a43 Add script to print out a committer authormap file for a project's repo diff -r e2c122809c5c -r e2a3230f61fa .svn/wc.db Binary file .svn/wc.db has changed diff -r e2c122809c5c -r e2a3230f61fa extra/soundsoftware/get-repo-authormap.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extra/soundsoftware/get-repo-authormap.rb Tue May 19 16:14:34 2015 +0100 @@ -0,0 +1,18 @@ + +# Print out an authormap file for hg-to-git conversion using +# hg-fast-export +# +# Invoke with the project identifier as argument, e.g. +# +# ./script/rails runner -e production extra/soundsoftware/get-repo-authormap.rb soundsoftware-site + +proj_ident = ARGV[1] + +proj = Project.find_by_identifier(proj_ident) +repo = Repository.where(:project_id => proj.id).first +csets = Changeset.where(:repository_id => repo.id) +committers = csets.map do |c| c.committer end.sort.uniq +committers.each do |c| + u = repo.find_committer_user c + print "#{c}=#{u.name} <#{u.mail}>\n" unless u.nil? +end