Step 1.从subversion官网下载安装程序,下载地址为:http://sourceforge.net/projects/win32svn/(这个是Windows版的~)。安装之后就有了svn.exe这个基于命令行的客户端工具,安装程序把svn.exe的路径加入了path环境变量,我们已经可以在命令行中直接输入svn就可以使用了;
Step 2.从SVN仓库拉取最新的项目,svn checkout [svn地址] --username [用户名];
Step 3.进入到工作目录,生成SVN Log文件:svn log -v --xml > logfileName.log;logfileName.log为log文件的名称;
Step 4.到StatSvn的官网下载StatSvn的压缩包,官网地址:http://www.statsvn.org/;解压到硬盘随意一个目录,会发现里面有个StatSvn的jar包~;
Step 5.调用StatSvn的命令进行统计:java -jar statsvn.jar [LogFile Path] [SVN CheckOut Path]
执行完上面的步骤,会发现在解压的statSvn的文件夹下生成了一大堆的文件,找到index.html双击打开查看统计结果~
Some options:
-version print the version information and exit
-output-dir <dir> directory where HTML suite will be saved
-include <pattern> include only files matching pattern, e.g. **/*.c;**/*.h
-exclude <pattern> exclude matching files, e.g. tests/**;docs/**
-tags <regexp> show matching tags in lines of code chart, e.g. version-.*
-title <title> Project title to be used in reports
-viewvc <url> integrate with ViewVC installation at <url>
-trac <url> integrate with Trac at <url>
-bugzilla <url> integrate with Bugzilla installation at <url>
-username <svnusername> username to pass to svn
-password <svnpassword> password to pass to svn
-verbose print extra progress information
-xdoc optional switch output to xdoc
-xml optional switch output to xml
-threads <int> how many threads for svn diff (default: 25)
-concurrency-threshold <millisec> switch to concurrent svn diff if 1st call>threshol
-dump dump the Repository content on console
-charset <charset> specify the charset to use for html/xdoc
-tags-dir <directory> optional, specifies the director for tags (default '/tags/')
Full options list: http://www.statsvn.org