Ignore:
Timestamp:
Apr 9, 2009, 10:18:54 PM (12 years ago)
Author:
Jari Häkkinen
Message:

Merged trunk changes r645:782 to replacing_gnuplot branch.

Location:
branches/replacing_gnuplot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/replacing_gnuplot

    • Property svn:ignore
      •  

        old new  
        88autom4te.cache
        99INSTALL
        10 COPYING
        1110aclocal.m4
        1211Makefile
  • branches/replacing_gnuplot/lib/Node.cc

    r646 r784  
    33/*
    44  Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson
    5 
    6   This file is part of svndigest, http://trac.thep.lu.se/svndigest
     5  Copyright (C) 2008 Jari Häkkinen
     6  Copyright (C) 2009 Peter Johansson
     7
     8  This file is part of svndigest, http://dev.thep.lu.se/svndigest
    79
    810  svndigest is free software; you can redistribute it and/or modify it
    911  under the terms of the GNU General Public License as published by
    10   the Free Software Foundation; either version 2 of the License, or
     12  the Free Software Foundation; either version 3 of the License, or
    1113  (at your option) any later version.
    1214
     
    1719
    1820  You should have received a copy of the GNU General Public License
    19   along with this program; if not, write to the Free Software
    20   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    21   02111-1307, USA.
     21  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
    2222*/
    2323
     
    2525
    2626#include "Date.h"
     27#include "HtmlStream.h"
    2728#include "html_utility.h"
    2829#include "SVNlog.h"
     
    7778      return svninfo_.last_changed_author();
    7879    assert(log().commits().size());
    79     return log().commits().back().author();
     80    return log().latest_commit().author();
    8081  }
    8182
     
    144145      return svninfo_.last_changed_rev();
    145146    assert(log().commits().size());
    146     return log().commits().back().revision();
     147    return log().latest_commit().revision();
    147148  }
    148149
     
    150151  const SVNlog& Node::log(void) const
    151152  {
    152     if (!log_)
     153    if (!log_) {
    153154      if (ignore())
    154155        log_ = new SVNlog;
    155       else
    156         log_ = new SVNlog(log_core());
     156      else {
     157        log_ = new SVNlog(path());
     158        log_core(*log_);
     159      }
     160    }
    157161    return *log_;
    158162  }
     
    203207    if (verbose)
    204208      std::cout << "Printing output for " << path_ << std::endl;
    205     SVNlog log(path_);
     209    const SVNlog& log = this->log();
    206210    typedef std::map<std::string, Stats*>::const_iterator iter;
    207211
     
    229233                                  const SVNlog& log) const
    230234  {
     235    HtmlStream hs(os);
    231236    os << "<h3>Author Summary</h3>";
    232237    os << "<table class=\"listings\">\n";
     
    252257
    253258    // print authors
    254     const std::string timefmt("%e/%m/%y %H:%M:%S");
     259    const std::string timefmt("%Y-%m-%d  %H:%M");
    255260    for (std::set<std::string>::const_iterator i=stats.authors().begin();
    256261         i!=stats.authors().end(); ++i){
     
    267272         << "</td><td>" << stats.empty(*i);
    268273      if (log.exist(*i)) {
    269         Commitment lc(log.latest_commit(*i));
     274        const Commitment& lc(log.latest_commit(*i));
    270275        os << "</td>" << "<td>" << trac_revision(lc.revision())
    271            << "</td>" << "<td>" << Date(lc.date())(timefmt);
     276           << "</td>" << "<td>";
     277        hs << Date(lc.date())(timefmt);
    272278      }
    273279      else {
     
    295301    os << "<td>" << stats.comments() << "</td>\n";
    296302    os << "<td>" << stats.empty() << "</td>\n";
    297     Commitment lc(log.latest_commit());
     303    const Commitment& lc(log.latest_commit());
    298304    os << "<td>" << trac_revision(lc.revision()) << "</td>\n";
    299     os << "<td>" << Date(lc.date())(timefmt)<< "</td>\n";
     305    os << "<td>";
     306    hs << Date(lc.date())(timefmt);
     307    os << "</td>\n";
    300308    os << "</tr>\n";
    301309    os << "</tbody>\n";
     
    304312
    305313 
     314  void Node::print_copyright(std::map<std::string,Alias>& alias,
     315                             bool verbose) const
     316  {
     317    // map with last rev for every year
     318    std::map<int, svn_revnum_t> year2rev;
     319    SVNlog log(path());
     320    typedef SVNlog::container::const_iterator LogIterator;
     321    for (LogIterator i=log.commits().begin(); i!=log.commits().end(); ++i){
     322      time_t sec = str2time(i->date());
     323      tm* timeinfo = gmtime(&sec);
     324      year2rev[timeinfo->tm_year] = i->revision();
     325    }
     326    print_copyright(alias, verbose, year2rev);
     327  }
     328
     329
    306330  std::string Node::url(void) const
    307331  {
Note: See TracChangeset for help on using the changeset viewer.