Changeset 1197
- Timestamp:
- Oct 4, 2010, 6:32:09 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/svndigest.cc
r1186 r1197 24 24 #include "lib/Configuration.h" 25 25 #include "lib/css.h" 26 #include "lib/Date.h" 26 27 #include "lib/Directory.h" 27 28 #include "lib/first_page.h" … … 42 43 #include <cassert> 43 44 #include <cstdlib> 45 #include <ctime> 44 46 #include <iostream> 45 47 #include <fstream> … … 198 200 std::cout << "Retrieving dates" << std::endl; 199 201 SVNlog log(repo); 200 std::vector< std::string> dates;202 std::vector<time_t> dates; 201 203 dates.reserve(log.commits().size()); 202 204 for (SVNlog::container::const_iterator iter=log.commits().begin(); 203 205 iter!=log.commits().end(); ++iter) { 204 206 assert(static_cast<svn_revnum_t>(dates.size())==iter->revision()); 205 dates.push_back( iter->date());207 dates.push_back(Date(iter->date()).seconds()); 206 208 } 207 209 // all plots uses the same dates -
trunk/lib/File.cc
r1186 r1197 268 268 } 269 269 else { 270 last = Date(Graph::xticks().back()).seconds();270 last = Graph::xticks().back(); 271 271 // earliest date corresponds either to revision 0 or revision 1 272 first = std::min(Date(Graph::xticks()[0]).seconds(), 273 Date(Graph::xticks()[1]).seconds()); 272 first = std::min(Graph::xticks()[0],Graph::xticks()[1]); 274 273 } 275 274 // color is calculated linearly on time, c = kt + m -
trunk/lib/Graph.cc
r1194 r1197 32 32 namespace svndigest { 33 33 34 std::vector< std::string> Graph::xticks_;34 std::vector<time_t> Graph::xticks_; 35 35 36 36 Graph::Graph(const std::string& filename, const std::string& format) … … 91 91 if (!plots_) { 92 92 // date[0] is not the oldest when repo is imported with cvs2svn 93 xmin_= date_xticks() ? 94 std::min( Date(xticks_[0]), Date(xticks_[1]) ).seconds() : 0; 95 xmax_= date_xticks() ? Date(xticks_.back()).seconds() : y.size(); 93 xmin_= date_xticks() ? std::min(xticks_[0], xticks_[1]) : 0; 94 xmax_= date_xticks() ? xticks_.back() : y.size(); 96 95 xrange_=xmax_-xmin_; 97 96 yrange_=ymax_-ymin_; … … 121 120 PLFLT x1=i; 122 121 if (date_xticks()) { 123 x0= Date(xticks_[i-1]).seconds();124 x1= Date(xticks_[i]).seconds();122 x0=xticks_[i-1]; 123 x1=xticks_[i]; 125 124 } 126 125 pls_.join(x0, y[i-1], x0, y[i]); … … 164 163 165 164 166 void Graph::set_dates(const std::vector< std::string>& date)165 void Graph::set_dates(const std::vector<time_t>& date) 167 166 { 168 167 xticks_=date; … … 186 185 187 186 188 const std::vector< std::string>& Graph::xticks(void)187 const std::vector<time_t>& Graph::xticks(void) 189 188 { 190 189 return xticks_; -
trunk/lib/Graph.h
r1194 r1197 28 28 #include "Vector.h" 29 29 30 #include <ctime> 30 31 #include <string> 31 32 #include <vector> … … 99 100 \brief Function setting the dates. 100 101 101 The date strings must be in svn format since underlying time 102 conversion are done with the Date class. 103 104 \see Date::svntime(std::string) 102 The date is given in seconds (since 1/1 1970) 105 103 */ 106 static void set_dates(const std::vector< std::string>& date);104 static void set_dates(const std::vector<time_t>& date); 107 105 108 106 /** … … 112 110 void timeformat(const std::string& format); 113 111 114 static const std::vector< std::string>& xticks(void);112 static const std::vector<time_t>& xticks(void); 115 113 116 114 /** … … 147 145 std::string timeformat_; 148 146 std::string title_; 149 static std::vector< std::string> xticks_;147 static std::vector<time_t> xticks_; 150 148 PLFLT xmin_, xmax_, xrange_, ymin_, ymax_, yrange_; 151 149 };
Note: See TracChangeset
for help on using the changeset viewer.