Changeset 123 for trunk/bin


Ignore:
Timestamp:
Jul 30, 2006, 12:42:54 AM (15 years ago)
Author:
Jari Häkkinen
Message:

Addresses ticket:23. Removed 'svn log' for revision-date extraction.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svnstat.cc

    r117 r123  
    2424#include "Parameter.h"
    2525
    26 #include "CommitStat.h"
    2726#include "Directory.h"
    2827#include "GnuplotFE.h"
     
    5150  }
    5251
     52  // Make sure that root directory is under subversion control.
    5353  SVN* svn=SVN::instance();
    5454  try {
     
    6161  }
    6262
     63  // Extract repository location
     64  std::string repo;
     65  try {
     66    repo=svn->repository(option->root());
     67  }
     68  catch (SVNException e) {
     69    std::cerr << "\nsvnstat: " << e.what()
     70              << "\nsvnstat: Failed to determine repository for "
     71              << option->root() << '\n' << std::endl;
     72    exit(-1);
     73  }
     74
     75  // Retrieve commit dates.
     76  std::vector<std::string> commit_dates;
     77  try {
     78    svn->setup_ra_session(repo);
     79    commit_dates=svn->commit_dates(repo);
     80  }
     81  catch (SVNException e) {
     82    std::cerr << "\nsvnstat: " << e.what() << std::endl;
     83    exit(-1);
     84  }
     85
     86  // check if target already exists and behave appropriately
    6387  if (option->force()){
    6488    std::string root_path(option->targetdir()+'/'+file_name(option->root()));
     
    78102      exit(-1);
    79103    }
    80 
    81104  }
    82105
    83   if (!option->revisions()) {
    84     if (option->verbose())
    85       std::cout << "Parsing the log." << std::endl;
    86     CommitStat cs;
    87     cs.parse(option->root());
    88     GnuplotFE::instance()->set_dates(cs.date());
    89   }
     106  if (!option->revisions())
     107    GnuplotFE::instance()->set_dates(commit_dates);
    90108
    91109  Directory tree(0,option->root(),"");
Note: See TracChangeset for help on using the changeset viewer.