diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -67,6 +67,7 @@ test-check-pylint.t test-check-shbang.t test-children.t +test-churn.t test-clone-cgi.t test-clone-pull-corruption.t test-clone-r.t diff --git a/hgext/churn.py b/hgext/churn.py --- a/hgext/churn.py +++ b/hgext/churn.py @@ -8,7 +8,7 @@ '''command to display statistics about repository history''' -from __future__ import absolute_import +from __future__ import absolute_import, division import datetime import os @@ -205,7 +205,7 @@ '*' * charnum(sum(count))) def charnum(count): - return int(round(count * width / maxcount)) + return int(round(count * width // maxcount)) for name, count in rate: ui.write(format(name, count)) diff --git a/tests/test-churn.t b/tests/test-churn.t --- a/tests/test-churn.t +++ b/tests/test-churn.t @@ -52,7 +52,7 @@ $ hg churn -r :2 user2 2 *************************************************************** - user1 1 ******************************** + user1 1 ******************************* $ cd .. churn with aliases @@ -83,10 +83,10 @@ churn by hour $ hg churn -f '%H' -s - 06 1 ***************** + 06 1 **************** 09 2 ********************************* 12 4 ****************************************************************** - 13 1 ***************** + 13 1 **************** churn with separated added/removed lines @@ -94,16 +94,16 @@ $ 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 - user1 +3/-1 +++++++++++++++++++++++++++++++++++++++++-------------- - user3 +3/-0 +++++++++++++++++++++++++++++++++++++++++ + user1 +3/-1 ++++++++++++++++++++++++++++++++++++++++------------- + user3 +3/-0 ++++++++++++++++++++++++++++++++++++++++ user2 +2/-0 +++++++++++++++++++++++++++ churn --diffstat with color $ hg --config extensions.color= churn --config color.mode=ansi \ > --diffstat --color=always - user1 +3/-1 \x1b[0;32m+++++++++++++++++++++++++++++++++++++++++\x1b[0m\x1b[0;31m--------------\x1b[0m (esc) - user3 +3/-0 \x1b[0;32m+++++++++++++++++++++++++++++++++++++++++\x1b[0m (esc) + user1 +3/-1 \x1b[0;32m++++++++++++++++++++++++++++++++++++++++\x1b[0m\x1b[0;31m-------------\x1b[0m (esc) + user3 +3/-0 \x1b[0;32m++++++++++++++++++++++++++++++++++++++++\x1b[0m (esc) user2 +2/-0 \x1b[0;32m+++++++++++++++++++++++++++\x1b[0m (esc) @@ -112,7 +112,7 @@ $ hg churn -c user1 4 *************************************************************** user3 3 *********************************************** - user2 2 ******************************** + user2 2 ******************************* $ echo 'with space = no-space' >> ../aliases $ echo a >> a @@ -154,9 +154,9 @@ [user4@x.com] $ hg churn -c user1 4 ********************************************************* - user3 3 ******************************************* - user2 2 ***************************** - user4@x.com 2 ***************************** + user3 3 ****************************************** + user2 2 **************************** + user4@x.com 2 **************************** with space 1 ************** Test multibyte sequences in names @@ -165,28 +165,28 @@ $ hg --encoding utf-8 ci -m'changed bar' -u 'El NiƱo ' $ hg --encoding utf-8 churn -ct '{author|person}' user1 4 ********************************************************** - user3 3 ******************************************** + user3 3 ******************************************* user2 2 ***************************** user4 2 ***************************** - El Ni\xc3\xb1o 1 *************** (esc) - with space 1 *************** + El Ni\xc3\xb1o 1 ************** (esc) + with space 1 ************** Test --template argument, with backwards compatibility $ hg churn -t '{author|user}' user1 4 *************************************************************** user3 3 *********************************************** - user2 2 ******************************** - nino 1 **************** - with 1 **************** + user2 2 ******************************* + nino 1 *************** + with 1 *************** 0 user4 0 $ hg churn -T '{author|user}' user1 4 *************************************************************** user3 3 *********************************************** - user2 2 ******************************** - nino 1 **************** - with 1 **************** + user2 2 ******************************* + nino 1 *************** + with 1 *************** 0 user4 0 $ hg churn -t 'alltogether'