Changeset 1534


Ignore:
Timestamp:
Oct 6, 2012, 5:27:18 AM (9 years ago)
Author:
Peter Johansson
Message:

don't complain about existing output dir if --update option. Extend test to check that untouched nodes are not re-printed. refs #334

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svndigest.cc

    r1515 r1534  
    235235                                             file_name(option.root()));
    236236  // remove target if needed
    237   if (node_exist(target_path)) {
    238     assert(option.force());
     237  if (node_exist(target_path) && option.force()) {
    239238    remove_target(target_path, option.verbose());
    240239  }
     
    253252  if (option.verbose())
    254253    std::cout << "Generating output" << std::endl;
    255   mkdir(option.root_basename());
     254  mkdir_p(option.root_basename());
    256255  chdir(option.root_basename());
    257256  print_css("svndigest.css");
    258   // create structure StatsType/Author/LineType
    259   /*
    260   for (std::map<std::string, Stats*>::const_iterator i(stats.stats().begin());
    261        i!=stats.stats().end(); ++i)
    262     create_file_struct(i->first+std::string("/"), *i->second);
    263   */
    264 }
     257}
  • trunk/bin/svndigestParameter.cc

    r1531 r1534  
    9898          throw yat::utility::cmd_error(ss.str());
    9999        }
    100         if (node_exist(path) && !force()) {
     100        // dont complain about existence if --force or --update
     101        if (node_exist(path) && !force() && !update()) {
    101102          std::stringstream ss;
    102103          ss << "svndigest: cannot create directory '" << path << "' "
  • trunk/test/update_test.sh

    r1533 r1534  
    4040test -s stderr && exit_fail
    4141
     42grep '^Printing output for ' stdout || exit_fail
     43
     44# lib/Node.cc hasn't been changed and should be printed again
     45grep '^Printing output for .*lib/Node.cc' stdout && exit_fail
     46
     47# directory bin hasn't changed and shouldn't...
     48grep '^Printing output for .*toy_project/bin' stdout && exit_fail
     49
    4250exit_success;
Note: See TracChangeset for help on using the changeset viewer.