开发者

Using Mercurial, how can I measure individual contributions?

My team is using Mercurial, and I would like to know the relative contributions by each team member. I know that we cannot measure productivity by lines of code, but I would like to see if each person at least contributed something, even if it was overwritten by o开发者_开发知识库thers later. So, I don't just want to see who is responsible for the current version (a la Mercurial annotate), but to do this recursively through all revisions, ideally with output that can be easily visualized or dumped into a spreadsheet.

Any tips?


There's an extension exactly for this, named churn, it is bundled with Mercurial, but not automatically enabled. You can find more information here: ChurnExtension.

In your mercurial.ini file, to the [extensions] section, add the following:

[extensions]
churn=

Then to look at the churn of your repository, just do:

hg churn

This will output something like this (this is for the Noda-Time project):

[C:\Dev\VS.NET\Noda-Time-docs] :hg churn
skeet@pobox.com              296444 *************************************************************************************************************
james.keesey@gmail.com       203877 ***************************************************************************
James Keesey                  80466 ******************************
dmitry.bulavin@gmail.com      25552 *********
Dmitry Bullavin               17657 ******
martinho.fernandes@gmail.com  16325 ******
Dmitry Bulavin                 4273 **
james.keesey                   2650 *
matt.scharley                   768
configurator                    450
lasse@vkarlsen.no                64
TeamCity@Nordrassil               2


Churn does the job, but note that it if a user moves files a lot, he will have huge amounts of changed lines. I just did a test, here are the results:

C:\Projects\personal\test>hg churn
darius.damalakas@gmail.com     10 *****************************************

C:\Projects\personal\test>hg mv a.a b.b
moving a.a to b.b

C:\Projects\personal\test>hg commit -m "moving 10 lines to another location"
b.b
committed changeset 1:c54200557152

C:\Projects\personal\test>hg churn
darius.damalakas@gmail.com     30 *****************************************

Note that I have only created 10 lines, but for moving a file I got 20 line changes. That does not convey a good picture.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜