Changeset 315 for trunk


Ignore:
Timestamp:
May 17, 2007, 2:06:17 PM (16 years ago)
Author:
Peter Johansson
Message:

fixes #186 catch exception thrown when node is not up to date

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svndigest.cc

    r312 r315  
    3737#include "utility.h"
    3838
     39#include <cassert>
    3940#include <iostream>
    4041#include <fstream>
     
    132133  if (option->verbose())
    133134    std::cout << "Building directory tree" << std::endl;
    134   Directory tree(0,option->root(),"");
     135  Directory* tree=NULL;
     136  try {
     137    tree = new Directory(0,option->root(),"");
     138  }
     139  catch (NodeException e) {
     140    std::cerr << "svndigest: " << e.what() << std::endl;
     141  }
     142  assert(tree);
     143
    135144  if (option->verbose())
    136145    std::cout << "Parsing directory tree" << std::endl;
    137146  Stats stats(option->root());
    138   stats+=tree.parse(option->verbose());
     147  stats+=tree->parse(option->verbose());
    139148
    140149  // Retrieve commit dates etc from SVNlog.
     
    162171    GnuplotFE::instance()->set_dates(svnlog.date());
    163172  chdir(option->targetdir().c_str());
    164   mkdir(tree.name());
    165   chdir(tree.name().c_str());
     173  mkdir(tree->name());
     174  chdir(tree->name().c_str());
    166175  GnuplotFE::instance()->command(std::string("cd '")+option->targetdir()+"/"
    167                                  +tree.name()+"'");
     176                                 +tree->name()+"'");
    168177  print_css("svndigest.css");
    169178  SVNlog local_log(option->root());
    170   print_main_page(tree.name(), local_log, stats,
     179  print_main_page(tree->name(), local_log, stats,
    171180                  SVNinfo(option->root()).url());
    172181  mkdir("all");
     
    180189    }
    181190  try {
    182     tree.print(option->verbose());
     191    tree->print(option->verbose());
    183192  }
    184193  catch (const std::runtime_error& x) {
     
    191200        std::cout << "Updating copyright statements" << std::endl;
    192201      std::map<std::string, Alias> alias(config.copyright_alias());
    193       tree.print_copyright(alias);
     202      tree->print_copyright(alias);
    194203    }
    195204    catch (const std::runtime_error& x) {
     
    202211
    203212  delete option;
     213  delete tree;
    204214  if (option->verbose())
    205215    std::cout << "Done!" << std::endl;
Note: See TracChangeset for help on using the changeset viewer.