使用svn来统计代码行数(增量和增量)

安装svn工具

1.安装TortoiseSVN,在安装时需要安装svn命令行工具。
2.下载statsvn ,这是一个用java写的工具,也是本文的主角,它就是一个jar包。下载后解压放在任意目录即可。

statsvn命令行配置列表

-version            查看当前版本
-output-dir <dir>         报告输出目录
-include <pattern>        统计包含的文件      e.g. **/*.c;**/*.h  
-exclude <pattern>     统计不包含的文件或者文件夹         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/')  

实例说明

上述是准备工作。操作的步骤如下:

  1. 使用svn的命令行导出配置库的日志文件(统计软件会根据这个日志进行代码统计),命令如下:
svn log -v --xml -r {2016-12-19}:{2016-10-09} > svn.log 

上述命令需要在配置库目录执行 ,svn.log就是生成的日志文件名称,上述命令导出了一个时间段的日志

svn log -v --xml  > svn.log

上述命令导出了所有时间端的文件

  1. 使用statsvn命令行根据上述导出的日志进行统计,首先进入statsvn的文件夹目录。之后执行命令如下:
java -jar statsvn.jar <svnlogpath>\svn.log <svnrootpath> -charset gbk -output-dir <reportoutpath>

上述是一个模板。具体的内容如下:

java -jar statsvn.jar D:\screwspace\webfront\snap-web\svn.log D:\screwspace\webfront\snap-web -charset gbk -output-dir D:\soft\statsvn\snap-web
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,746评论 19 139
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,295评论 6 342
  • Ubuntu的发音 Ubuntu,源于非洲祖鲁人和科萨人的语言,发作 oo-boon-too 的音。了解发音是有意...
    萤火虫de梦阅读 100,868评论 9 468
  • linux资料总章2.1 1.0写的不好抱歉 但是2.0已经改了很多 但是错误还是无法避免 以后资料会慢慢更新 大...
    数据革命阅读 13,410评论 2 33
  • 命令的使用 1、检出 svn cohttp://路径(目录或文件的全路径)[本地目录全路径] --username...
    小李龍彪阅读 4,550评论 0 9

友情链接更多精彩内容