--- a/metric-providers/org.ossmeter.metricprovider.trans.rascal.churnpercommit/src/Churn.rsc
+++ b/metric-providers/org.ossmeter.metricprovider.trans.rascal.churnpercommit/src/Churn.rsc
@@ -7,9 +7,13 @@
@doc{Count churn}
@friendlyName{Counts number of lines added and deleted per commit}
@appliesTo{generic()}
-map[str revision, int churn] churnPerCommit(ProjectDelta delta = \empty())
- = (co.revision : churn(co) | /VcsCommit co := delta)
- ;
+map[loc, int] churnPerCommit(ProjectDelta delta = \empty()) {
+ map[loc, int] result = ();
+ for (/VcsRepositoryDelta vcsDelta := delta) {
+ result += (vcsDelta.repository.url + co.revision : churn(co) | /VcsCommit co := vcsDelta);
+ }
+ return result;
+}
int churn(VcsCommit item)
= (0 | it + count | /linesAdded(count) := item)