Search code examples
mercurialmetricsmeasurement

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 others 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?


Solution

  • 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