Mercurial > hg
diff mercurial/cffi/bdiff.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/bdiff.py Sat Oct 05 10:29:34 2019 -0400 +++ b/mercurial/cffi/bdiff.py Sun Oct 06 09:45:02 2019 -0400 @@ -15,6 +15,7 @@ ffi = _bdiff.ffi lib = _bdiff.lib + def blocks(sa, sb): a = ffi.new("struct bdiff_line**") b = ffi.new("struct bdiff_line**") @@ -42,6 +43,7 @@ lib.bdiff_freehunks(l.next) return rl + def bdiff(sa, sb): a = ffi.new("struct bdiff_line**") b = ffi.new("struct bdiff_line**") @@ -62,8 +64,14 @@ while h: if h.a1 != la or h.b1 != lb: lgt = (b[0] + h.b1).l - (b[0] + lb).l - rl.append(struct.pack(">lll", (a[0] + la).l - a[0].l, - (a[0] + h.a1).l - a[0].l, lgt)) + rl.append( + struct.pack( + ">lll", + (a[0] + la).l - a[0].l, + (a[0] + h.a1).l - a[0].l, + lgt, + ) + ) rl.append(str(ffi.buffer((b[0] + lb).l, lgt))) la = h.a2 lb = h.b2