Mercurial > hg > soundsoftware-site
annotate extra/soundsoftware/get-repo-authormap.rb @ 1628:9c5f8e24dadc live tip
Quieten this cron script
author | Chris Cannam |
---|---|
date | Tue, 25 Aug 2020 11:38:49 +0100 |
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 |