Changeset 1254 for trunk


Ignore:
Timestamp:
Nov 1, 2010, 12:20:34 AM (10 years ago)
Author:
Peter Johansson
Message:

closes #228. Added count number of files and directories on first page. No count for individual authors.

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svndigest.cc

    r1234 r1254  
    3030#include "lib/html_utility.h"
    3131#include "lib/main_utility.h"
     32#include "lib/NodeCounter.h"
    3233#include "lib/rmdirhier.h"
    3334#include "lib/Stats.h"
     
    123124                             option.report());
    124125    tree.traverse(visitor);
    125     //    const StatsCollection& stats(tree.parse(option.verbose(),
    126     //                                      option.ignore_cache()));
     126    NodeCounter file_count;
     127    tree.traverse(file_count);
    127128
    128129    if (option.report())
    129       print_main_page(tree.name(), tree.log(), tree.stats(), tree.url());
     130      print_main_page(tree.name(), tree.log(), tree.stats(), tree.url(),
     131                      file_count);
    130132
    131133  }
  • trunk/lib/Makefile.am

    r1234 r1254  
    3535  Graph.h \
    3636  HtmlBuf.h HtmlStream.h html_utility.h LineTypeParser.h \
    37   main_utility.h Node.h NodeVisitor.h \
     37  main_utility.h Node.h NodeCounter.h NodeVisitor.h \
    3838  OptionVersion.h rmdirhier.h \
    3939  Stats.h StatsCollection.h subversion_info.h \
     
    4848  Functor.cc Graph.cc HtmlBuf.cc HtmlStream.cc \
    4949  html_utility.cc LineTypeParser.cc main_utility.cc Node.cc \
    50   OptionVersion.cc \
     50  NodeCounter.cc OptionVersion.cc \
    5151  rmdirhier.cc Stats.cc StatsCollection.cc subversion_info.cc SVN.cc \
    5252  SVNblame.cc SVNdiff.cc SvndigestVisitor.cc SVNinfo.cc \
  • trunk/lib/first_page.cc

    r1253 r1254  
    3131#include "HtmlStream.h"
    3232#include "html_utility.h"
     33#include "NodeCounter.h"
    3334#include "Stats.h"
    3435#include "StatsCollection.h"
     
    5253
    5354  void print_main_page(const std::string& dir, const SVNlog& log,
    54                        const StatsCollection& stats, std::string url)
     55                       const StatsCollection& stats, std::string url,
     56                       const NodeCounter& node_counter)
    5557  {
    5658    std::string filename="index.html";
     
    7375
    7476    print_summary_plot(os, stats["classic"]);
    75     print_general_information(os, log, authors.size(), url);
     77    print_general_information(os, log, authors.size(), url, node_counter);
    7678    sort(latest_commit.begin(), latest_commit.end(), GreaterRevision());
    7779    print_authors(os, latest_commit, stats["classic"]);
     
    8385
    8486  void print_general_information(std::ostream& os, const SVNlog& log,
    85                                  size_t nof_authors, std::string url)
     87                                 size_t nof_authors, std::string url,
     88                                 const NodeCounter& node_counter)
    8689  {
    8790    assert(log.commits().size());
     
    116119       << "</td></tr>\n"
    117120       << "<tr><td>Number of Authors:</td><td>" << nof_authors
     121       << "</td></tr>\n"
     122       << "<tr><td>Number of Directories:</td><td>"
     123       << node_counter.directories()
     124       << "</td></tr>\n"
     125       << "<tr><td>Number of Files:</td><td>"
     126       << node_counter.files()
    118127       << "</td></tr>\n"
    119128       << "</tbody>\n"
  • trunk/lib/first_page.h

    r978 r1254  
    3232
    3333  class Commitment;
     34  class NodeCounter;
    3435  class Stats;
    3536  class StatsCollection;
     
    4445  ///
    4546  void print_general_information(std::ostream&, const SVNlog&, size_t,
    46                                  std::string url);
     47                                 std::string url, const NodeCounter&);
    4748
    4849  ///
     
    5051  ///
    5152  void print_main_page(const std::string&, const SVNlog&,
    52                        const StatsCollection&, std::string url);
     53                       const StatsCollection&, std::string url,
     54                       const NodeCounter&);
    5355   
    5456  void print_recent_logs(std::ostream&, const SVNlog& log,
Note: See TracChangeset for help on using the changeset viewer.