Changeset 1124
- Timestamp:
- Jul 7, 2010, 7:35:17 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Stats.cc
r1122 r1124 289 289 290 290 291 svn_revnum_t Stats::load_cache(std::istream& is )291 svn_revnum_t Stats::load_cache(std::istream& is, bool& latest_ver) 292 292 { 293 293 std::string str; 294 294 getline(is, str); 295 if (str == "CACHE FILE VERSION 8") 295 if (str == "CACHE FILE VERSION 8") { 296 latest_ver = true; 296 297 return load_cache8(is); 298 } 299 latest_ver = false; 297 300 if (str == "CACHE FILE VERSION 7") 298 301 return load_cache7(is); -
trunk/lib/Stats.h
r1122 r1124 93 93 /** 94 94 Load object from a stream. 95 95 96 \a latest_ver is set to true if cache_file is latest version; 97 otherwise it is set to false. 98 96 99 \return revision the cache represents - 0 if failed 97 100 */ 98 svn_revnum_t load_cache(std::istream& );101 svn_revnum_t load_cache(std::istream&, bool& latest_ver); 99 102 100 103 /** -
trunk/lib/StatsCollection.cc
r1081 r1124 63 63 bool result = true; 64 64 for (map::const_iterator i(stats_.begin()); i!=stats_.end(); ++i) { 65 svn_revnum_t cache_rev = i->second->load_cache(is); 65 bool latest_ver=true; 66 svn_revnum_t cache_rev = i->second->load_cache(is, latest_ver); 67 result &= latest_ver; 66 68 if (cache_rev < i->second->last_changed_rev()) { 67 69 result = false; -
trunk/test/cache_partial_test.cc
r1122 r1124 24 24 #include "Suite.h" 25 25 26 #include "lib/ ClassicStats.h"26 #include "lib/AddStats.h" 27 27 #include "lib/File.h" 28 28 #include "lib/SVN.h" 29 29 #include "lib/SVNinfo.h" 30 #include "lib/StatsCollection.h" 30 31 #include "lib/utility.h" 31 32 … … 65 66 // test that load of partial cache is successful 66 67 copy_file(test::src_filename("data/AUTHORS.svndigest-cache-r61"), cache_file); 67 ClassicStats cstats(filename);68 AddStats cstats(filename); 68 69 std::ifstream is(cache_file.c_str()); 69 svn_revnum_t rev = cstats.load_cache(is); 70 bool cache_ok=true; 71 cstats.load_cache(is, cache_ok); 72 cstats.load_cache(is, cache_ok); 73 svn_revnum_t rev = cstats.load_cache(is, cache_ok); 74 if (!cache_ok) { 75 suite.out() << "error: seems cache file " << cache_file << " is old\n"; 76 suite.add(false); 77 } 70 78 if (rev!=48) { 71 79 suite.out() << "load cache: " << cache_file << " returned " << rev << "\n" -
trunk/test/stats_test.cc
r1119 r1124 194 194 ClassicStats stats2(path()); 195 195 assert(in.good()); 196 if (!stats2.load_cache(in)){ 196 bool new_cache=true; 197 if (!stats2.load_cache(in, new_cache)){ 197 198 std::cout << "load_cache() failed\n"; 198 199 return false;
Note: See TracChangeset
for help on using the changeset viewer.