Mercurial > hg > soundsoftware-site
annotate extra/soundsoftware/get-repo-authormap.rb @ 1545:f81fcbde7eaf feature_1136
Merge
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Tue, 12 Jan 2016 15:14:36 +0000 |
parents | e55cbb9ba8bf |
children |
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@1537 | 9 proj_ident = ARGV.last |
Chris@1536 | 10 proj = Project.find_by_identifier(proj_ident) |
Chris@1536 | 11 repo = Repository.where(:project_id => proj.id).first |
Chris@1536 | 12 csets = Changeset.where(:repository_id => repo.id) |
Chris@1536 | 13 committers = csets.map do |c| c.committer end.sort.uniq |
Chris@1536 | 14 committers.each do |c| |
Chris@1537 | 15 if not c =~ /[^<]+<.*@.*>/ then |
Chris@1537 | 16 u = repo.find_committer_user c |
Chris@1537 | 17 print "#{c}=#{u.name} <#{u.mail}>\n" unless u.nil? |
Chris@1537 | 18 end |
Chris@1536 | 19 end |