19 if(line.find(
"markb@localhost.localdomain") != string::npos)
21 return "Mark Borgerding";
24 if(line.find(
"kayhman@contact.intra.cea.fr") != string::npos)
26 return "Guillaume Saupin";
35 size_t position_of_email_address = line.find_first_of(
'<');
36 if(position_of_email_address != string::npos)
41 if(line.find(
"hauke.heibel") != string::npos)
46 result = line.substr(0, position_of_email_address);
53 if(line.find(
"convert-repo") != string::npos)
60 size_t length =
result.length();
61 while(length >= 1 &&
result[length-1] ==
' ')
result.erase(--length);
69 map<string,int> contributors_map;
74 while(!getline(churn_out,line).eof())
77 size_t first_star = line.find_first_of(
'*');
78 if(first_star != string::npos) line.erase(first_star);
81 size_t length = line.length();
82 while(length >= 1 && line[length-1] ==
' ') line.erase(--length);
85 size_t last_space = line.find_last_of(
' ');
89 istringstream(line.substr(last_space+1)) >> number;
92 line.erase(last_space);
95 map<string,int>::iterator it = contributors_map.find(
name);
97 if(it == contributors_map.end())
98 contributors_map.insert(pair<string,int>(
name, number));
101 it->second += number;
105 return contributors_map;
112 size_t last_space =
name.find_last_of(
' ');
113 if(last_space >=
name.length()-1)
return name;
114 else return name.substr(last_space+1);
136 ifstream online_info;
137 online_info.open(
filename, ios::in);
138 while(!getline(online_info,line).eof())
140 string hgname, realname,
url, misc;
142 size_t last_bar = line.find_last_of(
'|');
143 if(last_bar == string::npos)
continue;
144 if(last_bar < line.length())
145 misc = line.substr(last_bar+1);
146 line.erase(last_bar);
148 last_bar = line.find_last_of(
'|');
149 if(last_bar == string::npos)
continue;
150 if(last_bar < line.length())
151 url = line.substr(last_bar+1);
152 line.erase(last_bar);
154 last_bar = line.find_last_of(
'|');
155 if(last_bar == string::npos)
continue;
156 if(last_bar < line.length())
157 realname = line.substr(last_bar+1);
158 line.erase(last_bar);
163 if(hgname.find(
"MercurialName") != string::npos)
continue;
165 list<contributor>::iterator it;
166 for(it=contributors_list.begin(); it != contributors_list.end() && it->name != hgname; ++it)
169 if(it == contributors_list.end())
175 contributors_list.push_back(
c);
193 list<contributor> contributors_list;
194 map<string,int>::iterator it;
195 for(it=contributors_map_for_changedlines.begin(); it != contributors_map_for_changedlines.end(); ++it)
199 c.changedlines = it->second;
201 contributors_list.push_back(
c);
206 contributors_list.sort();
208 cout <<
"{| cellpadding=\"5\"\n";
210 cout <<
"! Lines changed\n";
213 list<contributor>::iterator itc;
215 for(itc=contributors_list.begin(); itc != contributors_list.end(); ++itc)
217 if(itc->name.length() == 0)
continue;
218 if(
i%2) cout <<
"|-\n";
219 else cout <<
"|- style=\"background:#FFFFD0\"\n";
220 if(itc->url.length())
221 cout <<
"| [" << itc->url <<
" " << itc->name <<
"]\n";
223 cout <<
"| " << itc->name <<
"\n";
224 if(itc->changedlines)
225 cout <<
"| " << itc->changedlines <<
"\n";
227 cout <<
"| (no information)\n";
228 cout <<
"| " << itc->misc <<
"\n";
231 cout <<
"|}" << endl;