Fred Trotter wrote:
> Tried this on users... but it is appropriate here too.
> My googling the subject has turned up many requests for this
> type of script, but no solutions. I am interested in performing an
> analysis on the number of lines of code that are modified in a svn
> repository over time. To do this I simply need a way to see how many
> lines of code are in each revision number.
> There are dicussions in the past on this list which talk about there
> being no easy way to do this, or using multiple calls to svn diff to get
> the answer. Perhaps multiple calls to svn diff using a special diff
> syntax piped to wc?
> If no one has a solution to this problem then I intend to create one. So
> any advice to that end is helpful. I recognize, from previous posts,
> that svn internals are not designed to provide this, so I am not looking
> to create a "real time" tool. I will be satisfied with a "runs all night
> but gets the right answer" type script.
> Please advise,
The svndbadmin tool that comes with ViewVC (and is used for populating a
Bonsai-like database of commit metadata) performs calculations of this sort
by running 'diff' on each modified file in a revision (against its prior
state), grepping for the line-count headers in that diff output, and doing
arithmetic stuffs with it. This tool is written to be run as a post-commit
tool, at which time it populates the Bonsai-ish database with the info that
one recent commit.
Here's a link to the ViewVC view of that tool's source code:
C. Michael Pilato <email@example.com>
CollabNet <> www.collab.net <> Distributed Development On Demand
Received on Tue Mar 28 06:02:46 2006