Mercurial > hg > soundsoftware-site
comparison extra/soundsoftware/create-repo-authormaps.rb @ 1554:e5c9809534a2 feature_1136
Further fix to that
author | Chris Cannam |
---|---|
date | Wed, 13 Jan 2016 11:43:59 +0000 |
parents | baac54711ee9 |
children |
comparison
equal
deleted
inserted
replaced
1553:baac54711ee9 | 1554:e5c9809534a2 |
---|---|
103 # than one '<' in it, truncate it just before the first one, and | 103 # than one '<' in it, truncate it just before the first one, and |
104 # then look up the author name again. | 104 # then look up the author name again. |
105 # | 105 # |
106 if c =~ /<.*</ then | 106 if c =~ /<.*</ then |
107 # So this is a completely pathological case | 107 # So this is a completely pathological case |
108 c = c.sub(/\s*<.*$/, "") | |
109 user = User.find_by_id uid | 108 user = User.find_by_id uid |
110 if user.nil? then | 109 if user.nil? then |
111 # because the given committer is bogus, we must write something in the map | 110 # because the given committer is bogus, we must write something in the map |
112 authormap << "#{c}=#{user.name} <unknown@example.com>\n" | 111 name = c.sub(/\s*<.*$/, "") |
112 authormap << "#{c}=#{name} <unknown@example.com>\n" | |
113 else | 113 else |
114 authormap << "#{c}=#{user.name} <#{user.mail}>\n" | 114 authormap << "#{c}=#{user.name} <#{user.mail}>\n" |
115 end | 115 end |
116 elsif not c =~ /[^<]+<.*@.*>/ then | 116 elsif not c =~ /[^<]+<.*@.*>/ then |
117 # This is the "normal" case that needs work, where a user has | 117 # This is the "normal" case that needs work, where a user has |