Changeset 318 for trunk/bin


Ignore:
Timestamp:
May 18, 2007, 11:35:45 AM (14 years ago)
Author:
Jari Häkkinen
Message:

Fixes #167 and addresses #74. Interfaces have changed. SVN::instance usage has changed, read SVN class documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svndigest.cc

    r315 r318  
    22
    33/*
    4   Copyright (C) 2006 Jari Häkkinen, Peter Johansson
    5   Copyright (C) 2007 Peter Johansson
     4  Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson
    65
    76  This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest
     
    9089  }
    9190
    92   // Make sure that root directory is under subversion control.
    93   SVN* svn=SVN::instance();
     91  SVN* svn=NULL;
    9492  try {
    9593    if (option->verbose())
    96       std::cout << "Connecting to WC administrative area" << std::endl;
    97     svn->setup_wc_adm_access(option->root());
     94      std::cout << "Initializing SVN singleton." << std::endl;
     95    svn=SVN::instance(option->root());
    9896  }
    9997  catch (SVNException e) {
    100     std::cerr << "\nsvndigest: " << e.what() << "\nsvndigest: "
    101               << option->root()
    102               << " is not under subversion control\n" << std::endl;
     98    std::cerr << "\nsvndigest: " << e.what()
     99              << "\nsvndigest: failed to initilize subversion access for "
     100              << option->root() << std::endl;
    103101    exit(-1);
    104102  }
     
    127125  }
    128126
    129   // build directory tree already here ... if WC is upto date with
     127  // build directory tree already here ... if WC is not upto date with
    130128  // repo an exception is thrown. This avoids several costly
    131129  // statements below and will not remove a digest tree below if a
     
    146144  Stats stats(option->root());
    147145  stats+=tree->parse(option->verbose());
    148 
    149   // Retrieve commit dates etc from SVNlog.
    150   try {
    151     if (option->verbose())
    152       std::cout << "Retrieving commit dates" << std::endl;
    153     svn->setup_ra_session(repo);
    154   }
    155   catch (SVNException e) {
    156     std::cerr << "\nsvndigest: " << e.what() << std::endl;
    157     exit(-1);
    158   }
    159   SVNlog svnlog(repo);
    160146
    161147  // remove target if needed
     
    169155    std::cout << "Generating output" << std::endl;
    170156  if (!option->revisions())
    171     GnuplotFE::instance()->set_dates(svnlog.date());
     157    GnuplotFE::instance()->set_dates(SVNlog(repo).date());
    172158  chdir(option->targetdir().c_str());
    173159  mkdir(tree->name());
     
    187173    mkdir(*i);
    188174    touch(std::string(*i+"/index.html"));
    189     }
     175  }
    190176  try {
    191177    tree->print(option->verbose());
Note: See TracChangeset for help on using the changeset viewer.