How to count the number of changed or added lines in an SVN branch?

Cosidering beginRev as the initial revision of the changeset you want to measure and endRev as the final revision:

svn diff --summarize -rbeginRev:endRev <URLtoBranch>

This will give you the output of files added, deleted and modified.

I you want more detail level you could parse the svn diff output through diffstat:

svn diff -rbeginRev:endRev <URLtoBranch> | diffstat

This will return an histogram of the changes with information for each file, and a summary of files changed, lines added and deleted.


StatSVN might be what you are looking for. I used it a while back briefly and it seemed good for giving developers feedback. I'm not sure if it will give you exactly what you need but it might be worth a quick look.

Tags:

Svn