Mercurial > public > mercurial-scm > hg-stable
diff hgdemandimport/tracing.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 | 978c9a0c5974 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/hgdemandimport/tracing.py Sat Oct 05 10:29:34 2019 -0400 +++ b/hgdemandimport/tracing.py Sun Oct 06 09:45:02 2019 -0400 @@ -14,6 +14,7 @@ _checked = False _session = 'none' + def _isactive(): global _pipe, _session, _checked if _pipe is None: @@ -26,6 +27,7 @@ _session = os.environ.get('HGCATAPULTSESSION', 'none') return True + @contextlib.contextmanager def log(whencefmt, *whenceargs): if not _isactive(): @@ -48,6 +50,7 @@ except IOError: pass + def counter(label, amount, *labelargs): if not _isactive(): return