Changeset 703
- Timestamp:
- Nov 24, 2008, 4:58:58 AM (15 years ago)
- Location:
- trunk/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/AddStats.cc
r693 r703 62 62 std::mem_fun_ref(&Commitment::revision)); 63 63 for (RevSet::iterator rev_iter=revs.begin(); 64 rev_iter!=revs.end() && *rev_iter> rev; ++rev_iter){64 rev_iter!=revs.end() && *rev_iter>=rev; ++rev_iter){ 65 65 SVNblame svn_blame(path, *rev_iter); 66 66 LineTypeParser parser(path); … … 74 74 } 75 75 } 76 77 76 accumulate_stats(rev); 78 77 } -
trunk/lib/BlameStats.cc
r700 r703 83 83 std::mem_fun_ref(&Commitment::revision)); 84 84 for (RevSet::reverse_iterator rev_iter=revs.rbegin(); 85 rev_iter!=revs.rend() && *rev_iter> first_rev; ++rev_iter){85 rev_iter!=revs.rend() && *rev_iter>=first_rev; ++rev_iter){ 86 86 SVNblame svn_blame(path, *rev_iter); 87 87 LineTypeParser parser(path); -
trunk/lib/ClassicStats.cc
r693 r703 61 61 void ClassicStats::do_parse(const std::string& path, svn_revnum_t rev) 62 62 { 63 // we only call blame once so we can ignore rev here64 63 LineTypeParser parser(path); 65 64 SVNblame svn_blame(path); 66 65 while (svn_blame.valid()) { 67 add(svn_blame.author(), svn_blame.revision(), 68 parser.parse(svn_blame.line())); 66 if (svn_blame.revision()>=rev) { 67 add(svn_blame.author(), svn_blame.revision(), 68 parser.parse(svn_blame.line())); 69 } 69 70 svn_blame.next_line(); 70 71 } 71 accumulate_stats(); 72 72 accumulate_stats(rev); 73 73 } 74 74 -
trunk/lib/Stats.cc
r693 r703 67 67 svn_revnum_t rev) const 68 68 { 69 assert(rev>0); 69 70 if (vec.empty()){ 70 71 // just to allow call to vec.back() below 71 72 vec.resize(1,0); 72 73 } 73 else if (vec.begin()+rev < vec.end())74 std::partial_sum(vec.begin()+rev ,vec.end(),vec.begin()+rev);74 else if (vec.begin()+rev-1 < vec.end()) 75 std::partial_sum(vec.begin()+rev-1,vec.end(),vec.begin()+rev-1); 75 76 // static_cast to remove annoying compiler warning 76 77 if (vec.size() < static_cast<size_t>(revision()+1)) … … 81 82 void Stats::accumulate_stats(svn_revnum_t rev) 82 83 { 84 if (!rev) 85 rev = 1; 83 86 for (std::set<std::string>::const_iterator iter(authors().begin()); 84 87 iter!=authors().end(); ++iter) { -
trunk/lib/Stats.h
r701 r703 99 99 100 100 /** 101 Do the parsing for \a path. The function will only parse out 102 stats for revisions larger than \a rev. 101 Do the parsing for \a path. Revisions from \a rv will be parsed. 103 102 */ 104 103 void parse(const std::string& path, svn_revnum_t rev=0); … … 148 147 typedef Author2Vector::const_iterator A2VConstIter; 149 148 150 void accumulate_stats(svn_revnum_t rev=0); 149 /** 150 Calculate accumalated statistics for fundamental statistics, 151 i.e., code, comment, empty, and copyright for each author. 152 \see accumulate 153 */ 154 void accumulate_stats(svn_revnum_t rev=1); 151 155 void add_author(std::string); 152 156 void add_authors(std::set<std::string>::const_iterator, … … 198 202 std::string user) const; 199 203 private: 204 /** 205 \a vec is resized to revision(). 206 vec is accumulated such that 207 vec[rev] = vec[rev-1] + vec[rev] 208 vec[rev+1] = vec[rev] + vec[rev+1] 209 et cetera 210 */ 200 211 void accumulate(std::vector<unsigned int>& vec, 201 svn_revnum_t rev= 0) const;212 svn_revnum_t rev=1) const; 202 213 void add(std::vector<unsigned int>& vec, unsigned int rev, bool x, 203 214 unsigned int n); 204 215 205 virtual void do_parse(const std::string&, svn_revnum_t)=0; 216 /** 217 Parse statistics for fundamental categories, i.e., code, 218 comment, empty, and copyright for each author. Ignore revisions 219 earlier than \a first_rev. 220 */ 221 virtual void do_parse(const std::string&, svn_revnum_t first_rev)=0; 206 222 207 223 // Change this string if cache format is changed in such a way -
trunk/lib/StatsCollection.cc
r702 r703 67 67 if (!cache_rev) 68 68 i->second->reset(); 69 i->second->parse(path_, cache_rev );69 i->second->parse(path_, cache_rev+1); 70 70 } 71 71 }
Note: See TracChangeset
for help on using the changeset viewer.