Changeset 73 for trunk/bin


Ignore:
Timestamp:
Mar 4, 2006, 7:10:07 PM (15 years ago)
Author:
Jari Häkkinen
Message:

Divided Gnuplot class into a basic gnuplot communication class
and a front end class specialized for svnstat.
Added option to plot stats against time or revision.
Removed gnuplot usage of temporary files.

Location:
trunk/bin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/Parameter.cc

    r66 r73  
    1111
    1212  Parameter::Parameter(const int argc,const char *argv[])
    13     : force_(false), root_("."), targetdir_("svnstat_output"), verbose_(false)
    1413  {
    15  
     14    defaults();
    1615    for (int i=1; i<argc; i++) {
    1716      bool ok=false;
     
    3029          ok=true;
    3130        }
     31      }
     32      else if (myargv=="-rev" || myargv=="--revisions") {
     33          revisions_=true;
     34          ok=true;
    3235      }
    3336      else if (myargv=="-t" || myargv=="--target"){
     
    6164
    6265
     66  void Parameter::defaults(void)
     67  {
     68    force_=false;
     69    revisions_=false;
     70    root_=".";
     71    targetdir_="svnstat_output";
     72    verbose_=false;
     73  }
     74
     75
    6376  void Parameter::help(void)
    6477  {
     
    8093              << "  -r [--root] arg : svn controlled directory to perform\n"
    8194              << "                    statistics calculation on [.]\n"
     95              << "  -rev [--revisions]: Use revision numbers as time scale\n"
     96              << "                      instead of dates [dates].\n"
    8297              << "  -t [--target] arg : output directory [svnstat_output]\n"
    8398              << "  -v [--verbose] : explain what is being done\n"
  • trunk/bin/Parameter.h

    r49 r73  
    1414    Parameter(const int argc,const char *argv[]);
    1515    inline bool force(void) const { return force_; }
     16    inline bool revisions(void) const { return revisions_; }
    1617    inline const std::string& root(void) const { return root_; }
    1718    inline const std::string& targetdir(void) const { return targetdir_; }
     
    2021  private:
    2122    void analyse(void);
     23    void defaults(void);
    2224    void help(void);
    2325    void version(void);
    2426
    2527    bool force_;
     28    bool revisions_;
    2629    std::string root_;
    2730    std::string targetdir_;
    2831    bool verbose_;
    29 
    3032  };
    3133
  • trunk/bin/svnstat.cc

    r63 r73  
    44#include "CommitStat.h"
    55#include "Directory.h"
    6 #include "Gnuplot.h"
     6#include "GnuplotFE.h"
    77#include "rmdirhier.h"
    88
     
    3535  }
    3636
    37   if (option.verbose())
    38     std::cout << "Parsing the log." << std::endl;
    39   CommitStat cs;
    40   cs.parse(option.root());
    41   assert(cs.date()[0].size());
    42   Stats::gnuplot_pipe_.set_dates(cs.date());
     37  if (!option.revisions()) {
     38    if (option.verbose())
     39      std::cout << "Parsing the log." << std::endl;
     40    CommitStat cs;
     41    cs.parse(option.root());
     42    GnuplotFE::instance()->set_dates(cs.date());
     43  }
    4344 
    4445  string prefix("svnstat_");
     
    4748  tree.parse(option.verbose());
    4849
    49   Stats::gnuplot_pipe_.command(string("cd '")+option.targetdir()+"'");
     50  GnuplotFE::instance()->command(string("cd '")+option.targetdir()+"'");
    5051  chdir(option.targetdir().c_str());
    5152  try {
Note: See TracChangeset for help on using the changeset viewer.