0

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 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! (:

w1z
  • 537
  • 2
  • 5
  • 17

2 Answers2

1

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.

chetan
  • 933
  • 4
  • 11
0

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

Wolph
  • 78,177
  • 11
  • 137
  • 148
  • It souds good.. but I'm not a strongly skilled user of SVN. Can you provide some useful links as addition to your answer? thanks – w1z Apr 15 '10 at 21:39
  • I've added a link with an example of mailing the diff :) – Wolph Apr 15 '10 at 22:21