Mercurial > public > mercurial-scm > hg
diff mercurial/cffi/mpatchbuild.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 | 0585337ea787 |
children | 687b865b95ad |
line wrap: on
line diff
--- a/mercurial/cffi/mpatchbuild.py Sat Oct 05 10:29:34 2019 -0400 +++ b/mercurial/cffi/mpatchbuild.py Sun Oct 06 09:45:02 2019 -0400 @@ -4,12 +4,15 @@ import os ffi = cffi.FFI() -mpatch_c = os.path.join(os.path.join(os.path.dirname(__file__), '..', - 'mpatch.c')) +mpatch_c = os.path.join( + os.path.join(os.path.dirname(__file__), '..', 'mpatch.c') +) with open(mpatch_c) as f: - ffi.set_source("mercurial.cffi._mpatch", f.read(), - include_dirs=["mercurial"]) -ffi.cdef(""" + ffi.set_source( + "mercurial.cffi._mpatch", f.read(), include_dirs=["mercurial"] + ) +ffi.cdef( + """ struct mpatch_frag { int start, end, len; @@ -30,7 +33,8 @@ struct mpatch_flist *mpatch_fold(void *bins, struct mpatch_flist* (*get_next_item)(void*, ssize_t), ssize_t start, ssize_t end); -""") +""" +) if __name__ == '__main__': ffi.compile()