? commit_restrictions ? commitlog ? versioncontrol_account_status ? versioncontrol_fakevcs Index: versioncontrol.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/versioncontrol.module,v retrieving revision 1.76 diff -u -r1.76 versioncontrol.module --- versioncontrol.module 9 Nov 2007 20:23:25 -0000 1.76 +++ versioncontrol.module 7 Dec 2007 18:01:21 -0000 @@ -2095,6 +2095,36 @@ } /** + * Retrieve general statistics about what happened in a single commit. For more granular + * details about what happened in a single commit, use versioncontrol_get_commit_actions. + * + * @param $commit + * The commit to retrieve statistics about + * + * @return + * A structured array containing general statistics about this commit. The array will consist + * of elements with the following keys: + * + * - 'lines_added': Total number of lines added during this commit + * - 'lines_added_squared': Total of (number of lines added per action) squared, during this commit. + * Useful for calculating the standard deviation. + * - 'lines_removed': Total number of lines removed during this commit + * - 'lines_removed_squared': Total of (number of lines removed per action) squared, during this commit. + * Useful for calculating the standard deviation. + * - 'action_count': Total number of actions within this commit + * + * These values are designed so that statistics from several commits can be combined, hence why totals + * are given rather than averages. A real-life example of such a result array can be found in the FakeVCS + * example module. + * + */ +function versioncontrol_get_commit_statistics($commit) { + return _versioncontrol_call_backend( + $commit['repository']['vcs'], 'get_commit_statistics', array($commit) + ); +} + +/** * Return the 'current item' of a commit action if there is one, * or the first (only) one of the 'source items' if the file has been deleted. * As this function is also being used within access checks, it also works