# HG changeset patch
# User Gábor Stefanik <gabor.stefanik@nng.com>
# Date 2017-04-10 16:16:30
# Node ID f3b80537a70dd73e4abcf9c49f36a0f4e43155ab
# Parent  02c3b1f396de82cb1b3fa9f074fd47d18187f583

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 --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -2161,7 +2161,7 @@ def unitcountfn(*unittable):
 
     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