source: trunk/lib/ClassicStats.cc @ 803

Last change on this file since 803 was 803, checked in by Peter Johansson, 12 years ago

fixes #338 - partial cache now works

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