[PATCH] churn: ability to display added/removed lines separately

Alexander Solovyov piranha at piranha.org.ua
Fri Oct 30 04:43:41 CDT 2009


On Fri, Oct 30, 2009 at 1:47 AM, Benoit Boissinot
<benoit.boissinot at ens-lyon.org> wrote:
> On Thu, Oct 29, 2009 at 08:50:37PM +0200, Alexander Solovyov wrote:
>>  % churn by hour
>> -06      1 ****************
>> +06      1 *****************
>>  09      2 *********************************
>>  12      4 ******************************************************************
>> -13      1 ****************
>> +13      1 *****************
>
> Why does those change?

Because of this:

+    def charnum(count):
+        return int(round(count*width/maxcount))

Earlier this was "int(count*width/maxcount))", which lead to problem when you
can have something like that:

user1 +x/-x ++--
user2 +x/-x +-
user3 +x/-x +--

i.e. sum of changed lines of user2 is bigger than user3, but it's
distributed in the way
that flooring (instead of rounding) will draw less characters.

-- 
Alexander



More information about the Mercurial-devel mailing list