diff --git a/hgext/churn.py b/hgext/churn.py --- a/hgext/churn.py +++ b/hgext/churn.py @@ -63,7 +63,7 @@ def countrate(ui, repo, amap, *pats, **o key = getkey(ctx) key = amap.get(key, key) # alias remap if opts.get('changesets'): - rate[key] = rate.get(key, 0) + 1 + rate[key] = (rate.get(key, (0,))[0] + 1, 0) else: parents = ctx.parents() if len(parents) > 1: diff --git a/tests/test-churn b/tests/test-churn --- a/tests/test-churn +++ b/tests/test-churn @@ -55,6 +55,9 @@ hg rm d/g/f2.txt hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt hg churn --diffstat +echo % changeset number churn +hg churn -c + cd .. # issue 833: ZeroDivisionError diff --git a/tests/test-churn.out b/tests/test-churn.out --- a/tests/test-churn.out +++ b/tests/test-churn.out @@ -32,5 +32,9 @@ 13 1 ***************** user1 +3/-1 +++++++++++++++++++++++++++++++++++++++++-------------- user3 +3/-0 +++++++++++++++++++++++++++++++++++++++++ user2 +2/-0 +++++++++++++++++++++++++++ +% changeset number churn +user1 4 *************************************************************** +user3 3 *********************************************** +user2 2 ******************************** adding foo test 0