Ignore:
Timestamp:
Jun 4, 2008, 12:05:22 AM (13 years ago)
Author:
Jari Häkkinen
Message:

Merged trunk changes r608:645 to replacing_gnuplot branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/replacing_gnuplot/lib/first_page.cc

    r556 r646  
    5959    using namespace std;
    6060    set<string> authors;
    61     authors.insert(log.author().begin(), log.author().end());
     61    std::transform(log.commits().begin(), log.commits().end(),
     62                   std::inserter(authors, authors.begin()), GetAuthor());
    6263    // erase invalid authors
    6364    authors.erase("");
     
    8283                                 size_t nof_authors, std::string url)
    8384  {
    84     assert(log.date().size());
    85     Date begin(log.date()[0]);
    86     Date end(log.date().back());
     85    assert(log.commits().size());
     86    Date begin(log.commits()[0].date());
     87    Date end(log.commits().back().date());
    8788    std::string timefmt("%a, %e %b %Y  %H:%M:%S");
    8889
     
    101102    os << end.difftime(begin);
    102103    os << "</td></tr>\n"
    103        << "<tr><td>Smallest Revision:</td><td>" << log.revision()[0]
    104        << "</td></tr>\n"
    105        << "<tr><td>Largest Revision:</td><td>" << log.revision().back()
    106        << "</td></tr>\n"
    107        << "<tr><td>Revision Count:</td><td>" << log.revision().size()
     104       << "<tr><td>Smallest Revision:</td><td>" << log.commits()[0].revision()
     105       << "</td></tr>\n"
     106       << "<tr><td>Largest Revision:</td><td>" <<log.commits().back().revision()
     107       << "</td></tr>\n"
     108       << "<tr><td>Revision Count:</td><td>" << log.commits().size()
    108109       << "</td></tr>\n"
    109110       << "<tr><td>Number of Authors:</td><td>" << nof_authors
     
    154155
    155156    os << "</table></div>\n";
    156    
    157157  }
    158158
     
    166166       << "</th></tr></thead>\n";
    167167
    168     std::vector<std::string>::const_reverse_iterator a=log.author().rbegin();
    169     std::vector<std::string>::const_reverse_iterator d=log.date().rbegin();
    170     std::vector<std::string>::const_reverse_iterator m=log.message().rbegin();
    171     std::vector<size_t>::const_reverse_iterator r=log.revision().rbegin();
    172     assert(log.author().size()==log.date().size());
    173     assert(log.author().size()==log.message().size());
    174     assert(log.author().size()==log.revision().size());
    175168    os << "<tr><td>Author</td><td>Date</td><td>Rev</td><td>Added</td>"
    176169       << "<td>Removed</td><td>Message</td></tr>\n";
     
    179172    const size_t maxlength = 80;
    180173    const Configuration& conf = Configuration::instance();
    181     for (size_t i=0; i<10 && a!=log.author().rend(); ++i) {
     174    typedef std::vector<Commitment>::const_reverse_iterator iter;
     175    for (iter i=log.commits().rbegin();
     176         i < std::min(i+10,log.commits().rend()); ++i) {
    182177      os << "<tr><td>"
    183          << anchor(std::string("classic/")+*a+"/total/index.html",*a)
     178         << anchor(std::string("classic/")+i->author()+"/total/index.html",
     179                   i->author())
    184180         << "</td>";
    185       Date date(*d);
     181      Date date(i->date());
    186182      os << "<td>" << date(timefmt) << "</td>";
    187183      os << "<td>";
    188       os << trac_revision(*r);
     184      os << trac_revision(i->revision());
    189185      os << "</td>";
    190186      os << "<td>";
    191       int added = stats["add"](LineTypeParser::total, "all", *r) -
    192         stats["add"](LineTypeParser::total, "all", *r - 1);
     187      int added = stats["add"](LineTypeParser::total, "all", i->revision()) -
     188        stats["add"](LineTypeParser::total, "all", i->revision() - 1);
    193189      os << added;
    194190      os << "</td>";
    195191      os << "<td>";
    196       os << added - (stats["blame"](LineTypeParser::total, "all", *r) -
    197                      stats["blame"](LineTypeParser::total, "all", *r - 1));
     192      os << added-(stats["blame"](LineTypeParser::total, "all", i->revision()) -
     193                   stats["blame"](LineTypeParser::total,"all",i->revision()-1));
    198194      os << "</td>";
    199195      os << "<td>";
    200       std::string mess = *m;
     196      std::string mess = i->message();
    201197      // replace newlines with space
    202198      std::replace(mess.begin(), mess.end(), '\n', ' ');
     
    215211
    216212      os << "</td></tr>\n";
    217       ++a;
    218       ++d;
    219       ++m;
    220       ++r;
    221213    }
    222214    os << "</table></div>\n";
Note: See TracChangeset for help on using the changeset viewer.