[PATCH] util: fix human-readable printing of negative byte counts

Gábor Stefanik gabor.stefanik at nng.com
Tue Apr 11 12:37:45 EDT 2017


# HG changeset patch
# User Gábor Stefanik <gabor.stefanik at nng.com>
# Date 1491840990 -7200
#      Mon Apr 10 18:16:30 2017 +0200
# Node ID c3d89ef348120ead9c2280c55d05c7ce435ea589
# Parent  e0dc40530c5aa514feb6a09cf79ab6a3aa2ec331
util: fix human-readable printing of negative byte counts

Apply the same human-readable printing rules to negative byte counts as to
positive ones. Fixes output of debugupgraderepo.

diff -r e0dc40530c5a -r c3d89ef34812 mercurial/util.py
--- a/mercurial/util.py	Sat Apr 01 15:24:03 2017 -0700
+++ b/mercurial/util.py	Mon Apr 10 18:16:30 2017 +0200
@@ -2160,7 +2160,7 @@
 
     def go(count):
         for multiplier, divisor, format in unittable:
-            if count >= divisor * multiplier:
+            if abs(count) >= divisor * multiplier:
                 return format % (count / float(divisor))
         return unittable[-1][2] % count
 



--------------------------------------------------------------------------
This message, including its attachments, is confidential. For more information please read NNG's email policy here:
http://www.nng.com/emailpolicy/
By responding to this email you accept the email policy.




More information about the Mercurial-devel mailing list