Changeset 213


Ignore:
Timestamp:
Sep 15, 2006, 5:05:45 PM (13 years ago)
Author:
Peter Johansson
Message:

fixes #41 and refs #87 added output for individual developers. Links should be added from the main page.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svndigest.cc

    r207 r213  
    110110  if (option->verbose())
    111111    std::cout << "Parsing directory tree" << std::endl;
    112   tree.parse(option->verbose());
     112  Stats stats(option->root());
     113  stats+=tree.parse(option->verbose());
    113114
    114115  // Retrieve commit dates.
     
    144145  print_main_page(tree.name(), commit_dates);
    145146  mkdir("all");
     147  for (std::set<std::string>::const_iterator i = stats.authors().begin();
     148       i!=stats.authors().end(); ++i) {
     149    mkdir(*i);
     150    }
    146151  try {
    147152    tree.print(option->verbose());
  • trunk/lib/Directory.cc

    r212 r213  
    129129    print("all", "empty");
    130130
     131    for (std::set<std::string>::const_iterator i = stats_.authors().begin();
     132         i!=stats_.authors().end(); ++i) {
     133      print(*i, "total");
     134      print(*i, "code");
     135      print(*i, "comments");
     136      print(*i, "empty");
     137    }
     138
    131139    // print daughter nodes, i.e., this function is recursive
    132140    for (NodeConstIterator i=daughters_.begin(); i!=daughters_.end(); ++i)
     
    146154    std::ofstream os(html_name.c_str());
    147155    assert(os.good());
    148     print_header(os, name(), level_+2, line_type, local_path()+"index.html");
     156    if (local_path().empty())
     157      print_header(os, name(), level_+2, line_type, "index.html");
     158    else
     159      print_header(os, name(), level_+2, line_type, local_path()+"/index.html");
    149160    path_anchor(os);
    150161    os << "<p align=center>\n<img src='"
     
    176187    for (NodeConstIterator d = daughters_.begin(); d!=daughters_.end(); ++d) {
    177188      if (dark)
    178         (*d)->html_tablerow(os,"dark");
     189        (*d)->html_tablerow(os,"dark", user);
    179190      else
    180         (*d)->html_tablerow(os,"light");
     191        (*d)->html_tablerow(os,"light", user);
    181192      dark = !dark;
    182193    }
     
    186197      os << "<tr class=\"light\">\n";
    187198    os << "<td>Total</td>\n";
    188     os << "<td>" << stats_.lines() << "</td>\n";
    189     os << "<td>" << stats_.code() << "</td>\n";
    190     os << "<td>" << stats_.comments() << "</td>\n";
    191     os << "<td>" << stats_.empty() << "</td>\n";
     199    if (user=="all"){
     200      os << "<td>" << stats_.lines() << "</td>\n";
     201      os << "<td>" << stats_.code() << "</td>\n";
     202      os << "<td>" << stats_.comments() << "</td>\n";
     203      os << "<td>" << stats_.empty() << "</td>\n";
     204    }
     205    else {
     206      os << "<td>" << stats_.lines(user) << "</td>\n";
     207      os << "<td>" << stats_.code(user) << "</td>\n";
     208      os << "<td>" << stats_.comments(user) << "</td>\n";
     209      os << "<td>" << stats_.empty(user) << "</td>\n";
     210    }
    192211    os << "<td>" << stats_.last_changed_rev() << "</td>\n";
    193212    os << "<td>" << author() << "</td>\n";
  • trunk/lib/File.cc

    r211 r213  
    130130    print("all", "comments");
    131131    print("all", "empty");
     132
     133    for (std::set<std::string>::const_iterator i = stats_.authors().begin();
     134         i!=stats_.authors().end(); ++i) {
     135      print(*i, "total");
     136      print(*i, "code");
     137      print(*i, "comments");
     138      print(*i, "empty");
     139    }
     140
    132141  }
    133142
  • trunk/lib/Node.cc

    r207 r213  
    8787
    8888  void Node::html_tablerow(std::ostream& os,
    89                            const std::string& css_class) const
     89                           const std::string& css_class,
     90                           const std::string& user) const
    9091  {
    9192    os << "<tr class=\"" << css_class << "\">\n"
     
    9798    else
    9899      anchor(os,href(), name());
    99     os << "</td>\n"
    100        << "<td>" << stats_.lines() << "</td>\n"
    101        << "<td>" << stats_.code() << "</td>\n"
    102        << "<td>" << stats_.comments() << "</td>\n"
    103        << "<td>" << stats_.empty() << "</td>\n"
    104        << "<td>" << stats_.last_changed_rev() << "</td>\n"
     100    os << "</td>\n";
     101    if (user=="all") {
     102      os << "<td>" << stats_.lines() << "</td>\n"
     103         << "<td>" << stats_.code() << "</td>\n"
     104         << "<td>" << stats_.comments() << "</td>\n"
     105         << "<td>" << stats_.empty() << "</td>\n";
     106    }
     107    else {
     108      os << "<td>" << stats_.lines(user) << "</td>\n"
     109         << "<td>" << stats_.code(user) << "</td>\n"
     110         << "<td>" << stats_.comments(user) << "</td>\n"
     111         << "<td>" << stats_.empty(user) << "</td>\n";
     112    }
     113    os << "<td>" << stats_.last_changed_rev() << "</td>\n"
    105114       << "<td>" << author() << "</td>\n"
    106115       << "</tr>\n";
  • trunk/lib/Node.h

    r207 r213  
    8484    virtual std::string href(void) const=0;
    8585
    86     void html_tablerow(std::ostream&, const std::string&) const;
     86    void html_tablerow(std::ostream&, const std::string&,
     87                       const std::string& user) const;
    8788
    8889    /**
  • trunk/lib/Stats.cc

    r209 r213  
    7474  {
    7575    if (!map.count(user))
    76       return std::vector<u_int>();
     76      return std::vector<u_int>(last_changed_rev_,0);
    7777    std::vector<u_int> vec=(map.find(user))->second;
    7878
Note: See TracChangeset for help on using the changeset viewer.