Changeset 482 for trunk/lib/File.cc


Ignore:
Timestamp:
Oct 13, 2007, 3:40:38 AM (14 years ago)
Author:
Peter Johansson
Message:

fixes #79 and #5. Only updating changed files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/File.cc

    r476 r482  
    194194      std::cout << "Parsing " << path_ << std::endl;
    195195    stats_.reset();
     196    std::string cache_dir = directory_name(path()) + std::string(".svndigest/");
     197    std::string cache_file = cache_dir + name()+std::string(".svndigest-cache");
     198    if (node_exist(cache_file)){
     199      std::ifstream is(cache_file.c_str());
     200      if (stats_.load_cache(is)){
     201        return stats_;
     202      }
     203      std::cout << "failed: " << path_ << std::endl;
     204    }
     205    stats_.reset();
    196206    stats_.parse(path_);
     207    if (!node_exist(cache_dir))
     208      mkdir(cache_dir);
     209    std::ofstream os(cache_file.c_str());
     210    stats_.print(os);
    197211    return stats_;
    198212  }
Note: See TracChangeset for help on using the changeset viewer.