Changeset 361


Ignore:
Timestamp:
Jun 11, 2007, 12:08:29 AM (13 years ago)
Author:
Peter Johansson
Message:

made links be counted as zero-liners. fixes #213

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/readme.txt

    r353 r361  
    7575other human readable files can be treated in single line basis whereas
    7676symbolic links and binary files cannot. svndigest treats binary files
    77 as zero-line files, whereas symbolic links are treated as one-line
    78 files. There is a possibility to exclude files from the statistics, the
    79 use of the property svndigest:ignore.
     77and symbolic links as zero-line files. There is a possibility to
     78exclude files from the statistics, the use of the property
     79svndigest:ignore.
    8080
    8181Sometimes large test files and XML files are added to the repository
  • trunk/lib/Node.cc

    r356 r361  
    3434#include <iostream>
    3535#include <sstream>
     36
     37#include <dirent.h>
     38#include <sys/stat.h>
    3639
    3740namespace theplu{
     
    5457    else
    5558      local_path_ = local_path + "/" + file_name(path);
     59
     60    struct stat nodestat;                // C api from sys/stat.h
     61    lstat(path.c_str(),&nodestat);   // C api from sys/stat.h
     62    link_ = S_ISLNK(nodestat.st_mode);
    5663  }
    5764
     
    7380    else if (binary())
    7481      os << name() << " (<i>binary</i>)";
     82    else if (link_)
     83      os << name() << " (<i>link</i>)";
    7584    // there is no output for nodes when user has zero contribution
    7685    else if (user!="all" && !stats_.lines(user))
  • trunk/lib/Node.h

    r356 r361  
    105105       @see SVNproperty::svndigest_ingorable
    106106    */
    107     inline bool ignore(void) const { return binary_ || svndigest_ignore_; }
     107    inline bool ignore(void) const
     108    { return binary_ || svndigest_ignore_ || link_; }
    108109
    109110    ///
     
    210211
    211212    bool binary_;
     213    bool link_;
    212214    bool svndigest_ignore_;
    213215    SVNinfo svninfo_;
  • trunk/lib/Stats.cc

    r345 r361  
    150150    while (const SVNblame::blame_information * bi=svn_blame.next()) {
    151151      assert(bi);
    152       // to handle symbolic links
    153       if (count==parser.type().end())
    154         add(bi->author, bi->revision, Parser::empty);
    155       else {
    156         add(bi->author, bi->revision, *count);
    157         ++count;
    158       }
     152      add(bi->author, bi->revision, *count);
     153      ++count;
    159154    }
    160155   
Note: See TracChangeset for help on using the changeset viewer.