Mercurial > public > mercurial-scm > hg
diff mercurial/cffi/mpatch.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 | 857876ebaed4 |
children | 687b865b95ad |
line wrap: on
line diff
--- a/mercurial/cffi/mpatch.py Sat Oct 05 10:29:34 2019 -0400 +++ b/mercurial/cffi/mpatch.py Sun Oct 06 09:45:02 2019 -0400 @@ -14,6 +14,7 @@ ffi = _mpatch.ffi lib = _mpatch.lib + @ffi.def_extern() def cffi_get_next_item(arg, pos): all, bins = ffi.from_handle(arg) @@ -25,14 +26,14 @@ return ffi.NULL return container[0] + def patches(text, bins): lgt = len(bins) all = [] if not lgt: return text arg = (all, bins) - patch = lib.mpatch_fold(ffi.new_handle(arg), - lib.cffi_get_next_item, 0, lgt) + patch = lib.mpatch_fold(ffi.new_handle(arg), lib.cffi_get_next_item, 0, lgt) if not patch: raise mpatchError("cannot decode chunk") outlen = lib.mpatch_calcsize(len(text), patch)