Changeset 130


Ignore:
Timestamp:
Aug 2, 2006, 8:46:27 PM (17 years ago)
Author:
Jari Häkkinen
Message:

Restructured some code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svnstat.cc

    r129 r130  
    8686
    8787  // check if target already exists and behave appropriately
    88   if (option->force()){
    89     std::string root_path(option->targetdir()+'/'+file_name(option->root()));
    90     struct stat buf;
    91     if (!stat(root_path.c_str(),&buf)){
     88  std::string root_path(option->targetdir()+'/'+file_name(option->root()));
     89  struct stat buf;
     90  if (!stat(root_path.c_str(),&buf))
     91    // root_path already exists
     92    if (option->force()) {
     93      // force true -> removal of root_path
    9294      if (option->verbose())
    9395        std::cout << "rm -rf " << root_path << "\n";
    9496      rmdirhier(root_path);
    9597    }
    96   }
    97   else {
    98     struct stat buf;
    99     std::string root_path(option->targetdir()+'/'+file_name(option->root()));
    100     if (!stat(root_path.c_str(),&buf)){
     98    else {
     99      // force false -> exit
    101100      std::cerr << "\nsvnstat: " << root_path << ": directory already exists"
    102101                << std::endl;
    103102      exit(-1);
    104103    }
    105   }
    106104
    107105  if (!option->revisions())
Note: See TracChangeset for help on using the changeset viewer.