source: trunk/lib/ClassicStats.cc @ 703

Last change on this file since 703 was 703, checked in by Peter Johansson, 13 years ago

fixed some issues that addresses #338. Want to add some tests before allowing --ignore-cache and closing ticket:338.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
RevLine 
[84]1// $Id: ClassicStats.cc 703 2008-11-24 03:58:58Z peter $
[14]2
[84]3/*
4  Copyright (C) 2005 Peter Johansson
[381]5  Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson
[84]6
[687]7  This file is part of svndigest, http://dev.thep.lu.se/svndigest
[84]8
[149]9  svndigest is free software; you can redistribute it and/or modify it
[84]10  under the terms of the GNU General Public License as published by
[693]11  the Free Software Foundation; either version 3 of the License, or
[84]12  (at your option) any later version.
13
[149]14  svndigest is distributed in the hope that it will be useful, but
[84]15  WITHOUT ANY WARRANTY; without even the implied warranty of
[149]16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[84]17  General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
[693]20  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
[84]21*/
22
[487]23#include "ClassicStats.h"
[129]24
[465]25#include "Functor.h"
[138]26#include "SVNblame.h"
[129]27#include "SVNinfo.h"
[14]28#include "utility.h"
29
[41]30#include <algorithm>
[65]31#include <cassert>
[63]32#include <cstdlib>
[454]33#include <fstream>
[60]34#include <iostream>
[454]35#include <iterator>
[14]36#include <map>
37#include <numeric>
38#include <string>
[138]39#include <sstream>
[44]40#include <unistd.h>
[23]41#include <utility>
[14]42#include <vector>
43
[63]44
[14]45namespace theplu{
[149]46namespace svndigest{
[14]47
48
[487]49  ClassicStats::ClassicStats(const std::string& path)
50    : Stats(path)
[80]51  {
52  }
53
[529]54
[528]55  ClassicStats::ClassicStats(const ClassicStats& other)
56  : Stats(other)
57  {
58  }
[80]59
[14]60
[664]61  void ClassicStats::do_parse(const std::string& path, svn_revnum_t rev)
[60]62  {
[552]63    LineTypeParser parser(path);
[185]64    SVNblame svn_blame(path);
[381]65    while (svn_blame.valid()) {
[703]66      if (svn_blame.revision()>=rev) {
67        add(svn_blame.author(), svn_blame.revision(), 
68            parser.parse(svn_blame.line()));
69      }
[381]70      svn_blame.next_line();
[138]71    }
[703]72    accumulate_stats(rev);
[60]73  }
74
75
[149]76}} // end of namespace svndigest and namespace theplu
Note: See TracBrowser for help on using the repository browser.