Changeset 1358 for trunk


Ignore:
Timestamp:
Jun 1, 2011, 1:38:22 AM (10 years ago)
Author:
Peter Johansson
Message:

rewrite of svncopyright to use its own Stats class, which means it's no longer using the cache. This version is slow and there are lots of space for speed-ups and there is no cache functionality yet. refs #385

Location:
trunk/lib
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/CopyrightVisitor.cc

    r1321 r1358  
    22
    33/*
    4   Copyright (C) 2010 Peter Johansson
     4  Copyright (C) 2010, 2011 Peter Johansson
    55
    66  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    2323
    2424#include "Configuration.h"
     25#include "CopyrightStats.h"
    2526#include "Directory.h"
    2627#include "File.h"
     
    175176      return;
    176177    }
    177     std::map<int, std::set<Alias> > map;
    178     create_year2alias(map, file);
     178    if (verbose_)
     179      std::cout << "Parsing '" << file.path() << "'\n";
     180    CopyrightStats stats(file.path(), ignore_cache_, alias_, year2rev_);
     181    const std::map<int, std::set<Alias> >& map = stats.map();
     182    assert(!map.empty());
    179183    std::string new_block = copyright_block(map, prefix);
    180184    if (old_block==new_block)
     
    231235    if (file.ignore() || file.svncopyright_ignore())
    232236      return;
    233     file.parse(verbose_, ignore_cache_);
    234237    update_copyright(file);
    235     file.stats().reset();
     238
     239    //file.parse(verbose_, ignore_cache_);
     240    //update_copyright(file);
     241    //file.stats().reset();
    236242  }
    237243
  • trunk/lib/Makefile.am

    r1337 r1358  
    2929noinst_HEADERS = AddStats.h Alias.h BlameStats.h CacheCopyer.h ClassicStats.h \
    3030  Colors.h Commitment.h Configuration.h \
    31   CopyrightVisitor.h css.h \
     31  CopyrightStats.h CopyrightVisitor.h css.h \
    3232  Date.h Directory.h DirectoryPrinter.h File.h FilePrinter.h \
    3333  first_page.h Functor.h \
     
    5252libsvndigest_core_a_SOURCES = AddStats.cc Alias.cc BlameStats.cc \
    5353  CacheCopyer.cc ClassicStats.cc Colors.cc \
    54   Commitment.cc Configuration.cc CopyrightVisitor.cc \
     54  Commitment.cc Configuration.cc CopyrightStats.cc CopyrightVisitor.cc \
    5555  css.cc Date.cc Directory.cc File.cc \
    5656  Functor.cc HtmlBuf.cc HtmlStream.cc \
Note: See TracChangeset for help on using the changeset viewer.