开发者

Subversion. Metrics. Get lines of added/updated code for each file in check-in programmatically

I need your advice. In my application I need to get programmatically such metrics for users check-ins as lines of added/updated code for 开发者_C百科each file in check-in. This app is writed on c# and uses the Subversion as version control system. How can I do it? Offer me your ideas please...

Thanks a lot! (:


well "hooks" are basically programs that get triggered when a particular svn event happens. Accordingly, the post-commit hook gets triggered after every commit. If you have access to your svn repository (as an admin, not just as a user), you should go to /path/to/repo/hooks directory and see the templates of various hooks that get run. Use the post-commit.tmpl file there as a template and add whatever you want. Note that whatever program/script gets run as the hook, automatcially gets arguments like name of the repo, current revision being checked in etc. as command line arguments. See here for reference:

http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html#svn.reposadmin.create.hooks

Then you can take the arguments and do whatever you like after every commit, including counting diff lines or what have you.


You could use a post-commit hook to automatically add it. Just parse the svnlook diff output and you're done.

Have a look at this example: http://techchorus.net/writing-php-script-send-svn-commit-changeset-email-notification

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜