Ignore:
Timestamp:
Nov 3, 2010, 2:35:39 AM (11 years ago)
Author:
Peter Johansson
Message:

refs #485

File:
1 edited

Legend:

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

    r1267 r1272  
    203203
    204204
    205 void set_dates(const svndigest::SVNlog& log)
     205void set_dates(const svndigest::SVNlog& log, svn_revnum_t last_rev)
    206206{
    207207  assert(!log.commits().empty());
     
    209209  Graph::rev_min(log.commits().begin()->revision());
    210210
    211   /*
    212      Fill in dates for revisions in log. Revisions not seen in log
    213      should not be used and left equal to 0.
    214    */
    215   std::vector<time_t> dates(log.latest_commit().revision()+1, 0);
     211  // Fill in dates for revisions in log.
     212  std::vector<time_t> dates(last_rev+1, 0);
    216213  for (SVNlog::container::const_iterator iter=log.commits().begin();
    217214       iter!=log.commits().end(); ++iter) {
    218215    assert(iter->revision()<static_cast<svn_revnum_t>(dates.size()));
    219216    dates[iter->revision()] = Date(iter->date()).seconds();
     217  }
     218  // Fill in dates for revs not seen in log
     219  time_t prev = dates[log.commits().begin()->revision()];
     220  for (size_t i=0; i<dates.size(); ++i) {
     221    if (dates[i]==0)
     222      dates[i] = prev;
     223    else
     224      prev = dates[i];
    220225  }
    221226
     
    238243    if (option.verbose())
    239244      std::cout << "Retrieving dates" << std::endl;
    240     set_dates(tree.log());
     245    // Note that last_changed_rev might be larger than lastest rev in log
     246    set_dates(tree.log(), tree.last_changed_rev());
    241247  }
    242248
Note: See TracChangeset for help on using the changeset viewer.