Ignore:
Timestamp:
Nov 5, 2010, 1:24:26 PM (11 years ago)
Author:
Peter Johansson
Message:

Let Graph class hold information about last point (rev_max_) rather
than defining via the size of Vector. Not resizing the Vectors means
we can avoid some copying in Stats class. But it also means we need to
handle the case of empty Vector in Stats::max_element. Made the
function Node::svn_info(void) public. In svndigest.cc set rev_min also
when not using dates as well as setting the new static variable rev_max.
closes #485

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9-stable/bin/svndigest.cc

    r1272 r1276  
    4444#include "yat/OptionArg.h"
    4545
     46#include <algorithm>
    4647#include <cassert>
    4748#include <cstdlib>
     
    203204
    204205
    205 void set_dates(const svndigest::SVNlog& log, svn_revnum_t last_rev)
    206 {
    207   assert(!log.commits().empty());
    208   // all plots uses the same xmin
    209   Graph::rev_min(log.commits().begin()->revision());
    210 
     206void set_dates(const svndigest::SVNlog& log)
     207{
    211208  // Fill in dates for revisions in log.
    212   std::vector<time_t> dates(last_rev+1, 0);
     209  std::vector<time_t> dates(log.latest_commit().revision()+1, 0);
    213210  for (SVNlog::container::const_iterator iter=log.commits().begin();
    214211       iter!=log.commits().end(); ++iter) {
     
    240237  }
    241238 
     239  if (option.verbose())
     240    std::cout << "Retrieving log information" << std::endl;
     241  assert(!tree.log().commits().empty());
     242  Graph::rev_min(tree.log().commits().begin()->revision());
     243  Graph::rev_max(tree.log().latest_commit().revision());
    242244  if (!option.revisions()) {
    243     if (option.verbose())
    244       std::cout << "Retrieving dates" << std::endl;
    245     // Note that last_changed_rev might be larger than lastest rev in log
    246     set_dates(tree.log(), tree.last_changed_rev());
     245    set_dates(tree.log());
    247246  }
    248247
Note: See TracChangeset for help on using the changeset viewer.