# HG changeset patch # User Chris Cannam # Date 1433244331 -3600 # Node ID 60acfbd8f6d6511e2993ec3faccf6aa5e16f976f # Parent 2696466256ff05f5221d9589843e008b74aaccf8 Use simpler saved committer list; ignore -e option (used for env) diff -r 2696466256ff -r 60acfbd8f6d6 extra/soundsoftware/create-repo-authormaps.rb --- a/extra/soundsoftware/create-repo-authormaps.rb Tue Jun 02 12:24:46 2015 +0100 +++ b/extra/soundsoftware/create-repo-authormaps.rb Tue Jun 02 12:25:31 2015 +0100 @@ -29,7 +29,8 @@ opts = GetoptLong.new( ['--scm-dir', '-s', GetoptLong::REQUIRED_ARGUMENT], - ['--out-dir', '-o', GetoptLong::REQUIRED_ARGUMENT] + ['--out-dir', '-o', GetoptLong::REQUIRED_ARGUMENT], + ['--environment', '-e', GetoptLong::REQUIRED_ARGUMENT] ) $repos_base = '' @@ -81,17 +82,16 @@ repo_url = repo.url repo_url = repo_url.gsub(/^file:\/*/, "/"); if repo_url != File.join($repos_base, proj.identifier) - puts 'Project #{proj.identifier} has repo in unsupported location #{repo_url}, skipping' + puts "Project #{proj.identifier} has repo in unsupported location #{repo_url}, skipping" next end - csets = repo.changesets - committers = csets.map do |c| c.committer end.sort.uniq + committers = repo.committers authormap = "" - committers.each do |c| + committers.each do |c, uid| if not c =~ /[^<]+<.*@.*>/ then - user = repo.find_committer_user c + user = User.find_by_id uid authormap << "#{c}=#{user.name} <#{user.mail}>\n" unless user.nil? end end