Mercurial > public > mercurial-scm > hg-stable
diff contrib/memory.py @ 43076:2372284d9457
formatting: blacken the codebase
This is using my patch to black
(https://github.com/psf/black/pull/826) so we don't un-wrap collection
literals.
Done with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S
# skip-blame mass-reformatting only
# no-check-commit reformats foo_bar functions
Differential Revision: https://phab.mercurial-scm.org/D6971
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 06 Oct 2019 09:45:02 -0400 |
parents | de5c9d0e02ea |
children | d4ba4d51f85f |
line wrap: on
line diff
--- a/contrib/memory.py Sat Oct 05 10:29:34 2019 -0400 +++ b/contrib/memory.py Sun Oct 06 09:45:02 2019 -0400 @@ -13,6 +13,7 @@ from __future__ import absolute_import + def memusage(ui): """Report memory usage of the current process.""" result = {'peak': 0, 'rss': 0} @@ -24,8 +25,13 @@ key = parts[0][2:-1].lower() if key in result: result[key] = int(parts[1]) - ui.write_err(", ".join(["%s: %.1f MiB" % (k, v / 1024.0) - for k, v in result.iteritems()]) + "\n") + ui.write_err( + ", ".join( + ["%s: %.1f MiB" % (k, v / 1024.0) for k, v in result.iteritems()] + ) + + "\n" + ) + def extsetup(ui): ui.atexit(memusage, ui)