Mercurial > hg > soundsoftware-site
annotate extra/soundsoftware/get-repo-authormap.rb @ 1536:e2a3230f61fa live
Add script to print out a committer authormap file for a project's repo
author | Chris Cannam |
---|---|
date | Tue, 19 May 2015 16:14:34 +0100 |
parents | |
children | e55cbb9ba8bf |
rev | line source |
---|---|
Chris@1536 | 1 |
Chris@1536 | 2 # Print out an authormap file for hg-to-git conversion using |
Chris@1536 | 3 # hg-fast-export |
Chris@1536 | 4 # |
Chris@1536 | 5 # Invoke with the project identifier as argument, e.g. |
Chris@1536 | 6 # |
Chris@1536 | 7 # ./script/rails runner -e production extra/soundsoftware/get-repo-authormap.rb soundsoftware-site |
Chris@1536 | 8 |
Chris@1536 | 9 proj_ident = ARGV[1] |
Chris@1536 | 10 |
Chris@1536 | 11 proj = Project.find_by_identifier(proj_ident) |
Chris@1536 | 12 repo = Repository.where(:project_id => proj.id).first |
Chris@1536 | 13 csets = Changeset.where(:repository_id => repo.id) |
Chris@1536 | 14 committers = csets.map do |c| c.committer end.sort.uniq |
Chris@1536 | 15 committers.each do |c| |
Chris@1536 | 16 u = repo.find_committer_user c |
Chris@1536 | 17 print "#{c}=#{u.name} <#{u.mail}>\n" unless u.nil? |
Chris@1536 | 18 end |