src/main.cpp

changeset 54
586dcd606e47
parent 52
e9edc3bd0301
equal deleted inserted replaced
53:1c80ba4a0d62 54:586dcd606e47
260 proc.chdir(repo.path); 260 proc.chdir(repo.path);
261 if (repo.type == fm::HG) { 261 if (repo.type == fm::HG) {
262 proc.setbin(settings.hg); 262 proc.setbin(settings.hg);
263 if (proc.exec_log({"log", 263 if (proc.exec_log({"log",
264 "--date", std::format("{0}-01-01 00:00:00 to {0}-12-31 23:59:59", report_year), 264 "--date", std::format("{0}-01-01 00:00:00 to {0}-12-31 23:59:59", report_year),
265 "--template", "{author}#{date|shortdate}\n"})) { 265 "--template", "{author}#{date|shortdate}#{desc|firstline}\n"})) {
266 fprintf(stderr, "Reading commit log for repo '%s' failed!\n", repo.path.c_str()); 266 fprintf(stderr, "Reading commit log for repo '%s' failed!\n", repo.path.c_str());
267 return EXIT_FAILURE; 267 return EXIT_FAILURE;
268 } 268 }
269 heatmap.add(settings, proc.output()); 269 heatmap.add(settings, proc.output());
270 } else { 270 } else {
271 proc.setbin(settings.git); 271 proc.setbin(settings.git);
272 if (proc.exec_log({"log", 272 if (proc.exec_log({"log",
273 "--since", std::format("{0}-01-01 00:00:00", report_year), 273 "--since", std::format("{0}-01-01 00:00:00", report_year),
274 "--until", std::format("{0}-12-31 23:59:59", report_year), 274 "--until", std::format("{0}-12-31 23:59:59", report_year),
275 "--format=tformat:%an <%ae>#%cs"})) { 275 "--format=tformat:%an <%ae>#%cs#%s"})) {
276 fprintf(stderr, "Reading commit log for repo '%s' failed!\n", repo.path.c_str()); 276 fprintf(stderr, "Reading commit log for repo '%s' failed!\n", repo.path.c_str());
277 return EXIT_FAILURE; 277 return EXIT_FAILURE;
278 } 278 }
279 heatmap.add(settings, proc.output()); 279 heatmap.add(settings, proc.output());
280 } 280 }
321 321
322 while (day_to_check <= report_end) { 322 while (day_to_check <= report_end) {
323 // get the entry from the heatmap 323 // get the entry from the heatmap
324 auto find_result = entries.find(day_to_check); 324 auto find_result = entries.find(day_to_check);
325 if (find_result == entries.end()) { 325 if (find_result == entries.end()) {
326 html::cell(day_to_check, 0); 326 html::cell(day_to_check);
327 } else { 327 } else {
328 html::cell(day_to_check, find_result->second); 328 html::cell(day_to_check, find_result->second);
329 } 329 }
330 // advance seven days and one column 330 // advance seven days and one column
331 day_to_check += days{7}; 331 day_to_check += days{7};

mercurial