source: trunk/lib/ClassicStats.cc @ 687

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

Merged patch release 0.6.6 to trunk. Delta 0.6.6 - 0.6.5

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
RevLine 
[84]1// $Id: ClassicStats.cc 687 2008-08-04 19:37:10Z 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
11  the Free Software Foundation; either version 2 of the License, or
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
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22  02111-1307, USA.
23*/
24
[487]25#include "ClassicStats.h"
[129]26
[465]27#include "Functor.h"
[138]28#include "SVNblame.h"
[129]29#include "SVNinfo.h"
[14]30#include "utility.h"
31
[41]32#include <algorithm>
[65]33#include <cassert>
[63]34#include <cstdlib>
[454]35#include <fstream>
[60]36#include <iostream>
[454]37#include <iterator>
[14]38#include <map>
39#include <numeric>
40#include <string>
[138]41#include <sstream>
[44]42#include <unistd.h>
[23]43#include <utility>
[14]44#include <vector>
45
[63]46
[14]47namespace theplu{
[149]48namespace svndigest{
[14]49
50
[487]51  ClassicStats::ClassicStats(const std::string& path)
52    : Stats(path)
[80]53  {
54  }
55
[529]56
[528]57  ClassicStats::ClassicStats(const ClassicStats& other)
58  : Stats(other)
59  {
60  }
[80]61
[14]62
[664]63  void ClassicStats::do_parse(const std::string& path, svn_revnum_t rev)
[60]64  {
[664]65    // we only call blame once so we can ignore rev here
[552]66    LineTypeParser parser(path);
[185]67    SVNblame svn_blame(path);
[381]68    while (svn_blame.valid()) {
[536]69      add(svn_blame.author(), svn_blame.revision(), 
70          parser.parse(svn_blame.line()));
[381]71      svn_blame.next_line();
[138]72    }
[537]73    accumulate_stats();
74
[60]75  }
76
77
[149]78}} // end of namespace svndigest and namespace theplu
Note: See TracBrowser for help on using the repository browser.